This repository was archived by the owner on Jul 18, 2026. It is now read-only.
Repository navigation
feat(cli): add login, whoami, and cloud import commands - #2
Draft
nomark-dev wants to merge 1 commit into
Draft
nomark-dev wants to merge 1 commit into
nomark-dev wants to merge 1 commit into
Conversation
- Add auth.ts: loadApiKey/saveApiKey/clearApiKey with 0600 config file permissions; reads NOMARK_TOKEN env var or ~/.nomark/config.json api_key - Add http.ts: cloudImport and probeAuth using process-import edge function - Add login.ts: interactive key entry + NOMARK_TOKEN env var flow - Add whoami.ts: probe-based auth check with uid/email display - Update import.ts: cloud mode (POST to edge) when authenticated, local mode unchanged; fix dryRun bug (was always true when flag absent) - Update index.ts: async main, login/whoami commands, VERSION 0.2.0 - Add README sections: Install, Authenticate, Import, Managing API Keys - Tests: auth.test.ts (15), http.test.ts (12) — all 288 tests pass - Coverage: 84.11% lines on src/ (threshold: 80%)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
nomarkCLI cloud authentication and import flow as specified in briefBRF-2026-04-12-nomark-cli.nomark login— prompts for API key (or readsNOMARK_TOKENenv var), validates against theprocess-importedge function, saves to~/.nomark/config.json(api_keyfield, mode 0600)nomark whoami— probes auth and prints uid/email; exits non-zero if unauthenticatednomark import --platform <chatgpt|claude|gemini>— when authenticated, POSTs to theprocess-importSupabase edge function; falls back to local parser mode when no API key is presentChanges
src/cli/auth.tssrc/cli/http.tssrc/cli/login.tssrc/cli/whoami.tssrc/cli/import.tssrc/cli/index.tsREADME.mdpackage.json@vitest/coverage-v8version to match vitest ^2.0.0tests/cli/auth.test.tstests/cli/http.test.tsTest plan
npm test)npm run build)src/— 84.11% ✓npx nomark --versionprints0.2.0npx nomark loginwithNOMARK_TOKENenv var validates and saves keynpx nomark whoamiprints uid/email or masked keynpx nomark import --platform chatgpt --file conversations.jsonroutes to cloud when key is presentSecurity
Authorization: Bearerheader; never logged, echoed, or in request body; config written 0600.github/workflows/publish.ymlNotes
process-importedge function or nomark-cloud schema (governance constraint respected)~/.nomark/config.jsoncoexists with the existingapiKey(camelCase, local LLM key fromconfig.ts) and newapi_key(snake_case, NOMARK cloud key fromauth.ts)nomark loginGenerated by Claude Code