This repository was archived by the owner on Jul 18, 2026. It is now read-only.
Repository navigation
feat(cli): add login, whoami, and import commands with API auth - #3
Draft
nomark-dev wants to merge 2 commits into
Draft
nomark-dev wants to merge 2 commits into
nomark-dev wants to merge 2 commits into
Conversation
- loginCommand: validates nomark_sk_ token against process-import endpoint, saves to ~/.nomark/config.json with chmod 0600 - whoamiCommand: reads stored token, validates against API, shows masked key - importCommand: supports chatgpt, claude, gemini platforms; reads file, POSTs to process-import with Bearer auth, prints ImportResult summary - config.ts: replace module-level constants with runtime functions so os.homedir() is evaluated at call time (fixes test isolation) - index.ts: wire login/whoami routes, update HELP text, bump VERSION 0.2.1 - 13 new tests for import, 5 for login, 5 for whoami, 7 for config - README: add Install, Authenticate, Import, Managing API Keys sections All 291 tests pass. Build succeeds (tsup). TypeScript clean.
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
nomark login— validates anomark_sk_API key against theprocess-importedge function, saves it to~/.nomark/config.json(chmod 0600). Reads fromNOMARK_TOKENenv or interactive prompt.nomark whoami— reads the stored token, validates it against the API, and prints the masked key on success. Exits 1 with a clear message if not authenticated.nomark import --platform <p> --file <f>— supportschatgpt,claude,gemini; parses the export file, POSTs toprocess-importwithAuthorization: Bearer, and prints anImportResultsummary (conversations analysed, signals extracted/promoted, by-confidence breakdown).config.tsfix — replaced module-levelCONFIG_DIR/CONFIG_PATHconstants (evaluated at import time) withgetConfigDir()/getConfigPath()runtime functions, fixing test isolation whenHOMEis overridden per-test.Security
fs.chmodSync(path, 0o600)after every save.https://cnwiskdzeygqxezmazoq.supabase.co/functions/v1/process-import.Test plan
npm test) — 13 new import tests, 5 login, 5 whoami, 7 confignpx tsc --noEmit)npm run build) — ESM + CJS + DTS all emitNOMARK_TOKEN=nomark_sk_... npx nomark loginsaves key and shows masked confirmationnpx nomark whoamishows authenticated statusnpx nomark import --platform chatgpt --file conversations.jsonprints ImportResult summaryGenerated by Claude Code