Add vektor login command #5
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#6 Add
vektor register command
austin/vektor
#7 Add
vektor project list and vektor project create
austin/vektor
#4 Add CLI config file management
austin/vektor
Reference
austin/vektor#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Authenticate against a Vektor server from the command line and store the API token for subsequent commands.
What needs to happen
vektor loginshould:POST /auth/loginto authenticatePOST /auth/tokento get a long-lived API tokenAlso create a reusable API client struct in
internal/cli/client.gothat handles:Authorization: Bearer <token>headerAll subsequent CLI commands will use this client.
Key files
cmd/vektor/main.go— add login subcommandinternal/cli/client.go— new, reusable HTTP clientinternal/cli/config.go— read/write tokenvektor registercommandvektor project listandvektor project create#7vektor project listandvektor project create