A CLI and Go package to interact with Microsoft Designer to generate images.
designer-cli "Flat vector illustration of a developer using a terminal"
Returns (after a few seconds):
INFO[0016] written 5031222530fccaa508c0a481694ae80f-0.jpg
INFO[0016] written 5031222530fccaa508c0a481694ae80f-1.jpg
INFO[0016] written 5031222530fccaa508c0a481694ae80f-2.jpg
The result output/5031222530fccaa508c0a481694ae80f-0.jpg
should return something like this:
- Go 1.20+
go install github.com/denysvitali/go-designer/cmd/designer-cli
designer-cli -h
- Visit https://designer.microsoft.com/
- Retrieve the token (two options)
- Open the Developer Tools and check the response for the request to:
https://login.microsoftonline.com/consumers/oauth2/v2.0/token
Copy the value ofaccess_token
in your clipboard and keep it for later - Generate an image and get the token from the
Authorization: Bearer TOKEN
header
- Open the Developer Tools and check the response for the request to:
- Store the token in the
DESIGNER_TOKEN
environment variable as follows:read -s -r DESIGNER_TOKEN # Paste your token and press ENTER export DESIGNER_TOKEN
Pretty straight-forward:
designer-cli "Your prompt goes here"
Flat vector illustration of ...