HumbleTurtle e1a4cf93f0 fix(cli): consolidate CLI dispatch surface and add nap project init
The dispatcher in `napseer_mcp_server.py::cli_main` had grown a duplicated
fragment of the project-command dispatcher (the attach/create/claim/status/
encryption block) that survived an earlier refactor. Because the fragment
was left at function-body indent after the `return` that closes the
canonical block, every `nap` subcommand that hands off to the MCP server
crashed at import time:

    File "/home/matias/.local/share/napseer/napseer_mcp_server.py",
    line 13561
        "frontend_url": cli_option(argv[3:], "--frontend-url",
                                   default=None),
    IndentationError: unexpected indent

That broke `nap project attach`, `nap project create`, `nap gateway
start`, and every other `nap *` command that dispatches to the MCP
server, surfacing as an "unknown command" / 401-style failure at the
caller. The pinned published revision `cbdc1840` still ships the broken
file; the next backend build needs to bump to this commit.

Rewrite `cli_main` so each `if command == "<cmd>":` block has a
single, complete dispatcher with no leftover fragments. Promote
`init` (first-time directory setup, no browser) to a canonical
`nap project init` subcommand, leave `attach` calling
`operator_loopback_login`, and `create` / `claim` unchanged.

Drop deprecated aliases (`ls`, `new`, `send`, `rm`, `set-status`,
`admin`, `global-list`, positional-state shortcut for
`nap project encryption set`, `process --all` shortcut) with clear
RuntimeError pointers to the canonical verbs.

Tests: `tests/test_cli_dispatch_consolidation.py` asserts canonical
verbs route correctly and dropped aliases raise with a clear pointer;
`tests/test_project_init_wizard.py` exercises the
`nap project init` wizard end-to-end;
`tests/test_nap_install_gateway_routes.py` updated for the
`process --all` removal. 19/19 pytest cases pass.

See /incidents/2026-06-15/napseer-mcp-server-py-13561-indentation-error-upstream
in Napseer memory for the prior incident writeup.
2026-06-15 14:10:39 -03:00
2026-05-03 11:27:56 -03:00
2026-05-17 09:00:47 -03:00
2026-05-19 16:56:13 -03:00
2026-05-03 11:27:56 -03:00

Napseer CLI

Source import for the nap operator CLI.

This repository is intended to become the canonical source for:

  • nap installer and update UX.
  • Project bootstrap and status commands.
  • Local authenticated MCP wrapper launch/update behavior.
  • Gateway command facade commands such as nap gateway start, nap gateway logs, and nap gateway update.

Current state:

  • resources/scripts/nap_install.py is copied from the backend pre-split implementation.
  • resources/scripts/ contains the runtime scripts currently installed by nap_install.py.
  • scripts/nap_install.py is kept as a convenient top-level command source copy during the initial import.
  • Gateway-specific implementation is still partially embedded in resources/scripts/napseer_mcp_server.py; it should move behind a gateway package/runtime boundary in a later extraction slice.

Backend discovery remains the compatibility source of truth during migration.

S
Description
Napseer command-line client and authenticated MCP runtime.
Readme
6.6 MiB
Languages
Python 100%