This repository was archived by the owner on Jul 18, 2026. It is now read-only.
Repository navigation
feat(cli): nomark CLI — login, import, whoami - #4
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
- login: saves api key to ~/.nomark/config.json (0600), reads NOMARK_TOKEN env var - import: POSTs conversation export to process-import edge function, supports chatgpt/claude/gemini - whoami: reads stored config and reports masked key - config: shared loadApiKey/saveConfig with HOME-relative path - args: parseArgs helper wired to index.ts dispatcher - CI: scope engine tests to packages/engine only, remove || true (fails-closed) - README: add Authenticate, Import, Managing API Keys sections - tests: 279 passing (login x4, import x10, whoami x4)
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 (work briefBRF-2026-04-12-nomark-cli) as a set of commands shipped inside the existing@nomark-ai/enginepackage.Commands added
nomark loginNOMARK_TOKENenv var or prompts interactively. Validatesnomark_sk_prefix. Writes~/.nomark/config.jsonat mode 0600. Never logs the full key.nomark whoami***last5).nomark import --platform <p> --file <f>process-importSupabase edge function. Supported:chatgpt,claude,gemini. Prints analyzed / extracted / promoted counts on success. Handles 401/403, 5xx, and network errors with actionable messages.Files changed
src/cli/login.ts— newsrc/cli/whoami.ts— newsrc/cli/config.ts— updated (HOME-relative path)src/cli/import.ts— rewritten (cloud POST)src/cli/index.ts— rewritten (async main, all commands wired)tests/cli/login.test.ts— new (4 tests)tests/cli/import.test.ts— new (10 tests)tests/cli/whoami.test.ts— new (4 tests)tests/fixtures/tiny-chatgpt.json— new (minimal fixture)README.md— expanded CLI section (Authenticate, Import, Managing API Keys).github/workflows/publish.yml— scoped test step topackages/engine; removed|| true(fails-closed)Test coverage
279 tests passing. Login, import, and whoami commands each have dedicated test suites covering: happy path, invalid key format, file not found, invalid JSON, 401, 500, network error.
Security
Out of scope (owner decision required)
process-importedge function or its schemav*tag (required to trigger publish) — owner's call per briefTest plan
npm test --workspace packages/engine— 279 tests passnpx nomark loginwithNOMARK_TOKEN=nomark_sk_...setnpx nomark whoamiafter loginnpx nomark import --platform chatgpt --file <export>with a real export file~/.nomark/config.jsonhas mode 0600 after loginGenerated by Claude Code