Skip to content

chore(loo-4703): config#1

Merged
notnmeyer merged 8 commits intomainfrom
chore/config
Mar 16, 2026
Merged

chore(loo-4703): config#1
notnmeyer merged 8 commits intomainfrom
chore/config

Conversation

@notnmeyer
Copy link
Copy Markdown
Member

@notnmeyer notnmeyer commented Mar 16, 2026

this is some initial plumbing bits around configuration before we get into interacting with the api.

  • adds a config package that manages env vars/api keys.
  • loops login will store the api key in keychain (macOS) or other pass keepers on different platforms. once ive wired up the api-key endpoint, we'll validate the key is valid before saving it.
  • loops logout will remove stored credentials.
  • LOOPS_API_KEY takes precedence over a stored key.
  • LOOPS_ENDPOINT_URL is only available in the env and used to override the prod api endpoint for testing purposes.
  • adds a temporary debug command to print the config setting that were selected.

login/out,

➜ task -- login
task: [default] go run ./... login
Enter your API key:
API key saved.

➜ task -- logout
task: [default] go run ./... logout
Logged out.

debug,

➜ task -- debug
task: [default] go run ./... debug
{
  "APIKey": "asdf",
  "EndpointURL": "https://app.loops.so/api/v1"
}

➜ LOOPS_ENDPOINT_URL=https://example.com LOOPS_API_KEY=ok task -- debug
task: [default] go run ./... debug
{
  "APIKey": "ok",
  "EndpointURL": "https://example.com"
}

@notnmeyer notnmeyer self-assigned this Mar 16, 2026
@notnmeyer notnmeyer changed the title chore: config chore(loo-4703): config Mar 16, 2026
@linear
Copy link
Copy Markdown

linear bot commented Mar 16, 2026

LOO-4703

@notnmeyer notnmeyer requested a review from nalanj March 16, 2026 19:03
@nalanj
Copy link
Copy Markdown

nalanj commented Mar 16, 2026

Something like https://github.com/zalando/go-keyring might be a better move for storing the API key, with env var as a fallback.

@notnmeyer
Copy link
Copy Markdown
Member Author

that actually winds up being simpler 👍

@notnmeyer notnmeyer merged commit 51f91f2 into main Mar 16, 2026
1 check passed
@notnmeyer notnmeyer deleted the chore/config branch March 30, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants