Commit Graph

46 Commits

Author SHA1 Message Date
José Almeida 47ff0804a5 feat(cli): make --port the user-facing port flag (#737)
* feat(cli): add --port flag as the user-facing port knob

Introduces --port (and KANDEV_PORT) as the primary, command-aware port
flag: in start/run it sets the Go backend port (the proxy front door
the browser actually hits), and in dev it sets the Next dev server port.
--backend-port and --web-port still work but emit a one-time stderr
deprecation note pointing at --port and --web-internal-port respectively.

* feat(cli): print labelled "open:" URL on startup

Replaces the ambiguous "[kandev] url:" / "ready at" lines with a
labelled block that always shows the user-facing URL first, plus the
backend (api) and web (internal) URLs when they differ. Each command
now declares its own publicUrl: backend in start/run (where the Go
server reverse-proxies Next.js), web in dev (browser hits Next direct).

* style(cli): apply prettier formatting to args.test.ts

* refactor(cli): tighten arg parsing per review feedback

- Validate value-taking flags (--port, --backend-port, --web-internal-port,
  --web-port, --version) and reject missing/non-numeric values with a clear
  ParseError instead of leaking NaN into the port validator.
- Drop the test-only _resetWarnedFlagsForTest export and the module-level
  warned-flag set; parseArgs now returns deduped deprecatedFlags and cli.ts
  emits warnings command-aware (e.g. --backend-port → KANDEV_BACKEND_PORT
  in dev, where --port maps to web).
- Stop double-printing the "open:" URL: logStartupInfo now lists labelled
  backend (api) / web (internal) URLs only, leaving the post-readiness
  open: line as the single source of truth.
- Fix help text: --web-internal-port works in dev too.
- Drop multi-line JSDoc blocks per CLAUDE.md style guide.

* fix(cli): validate env-var ports and collapse comment to one-liner

Catches non-numeric KANDEV_PORT / KANDEV_BACKEND_PORT / KANDEV_WEB_PORT in
envPort with a clear ParseError instead of letting NaN reach
ensureValidPort. Drops a multi-line comment per CLAUDE.md style.

* fix(cli): reject non-integer port values

Number.isFinite accepts floats like 3000.5 which then fail downstream
in ensureValidPort with a generic message. Tighten parsePort and
envPort to require integers and add float tests for both flag and
env-var paths.

* fix(cli): reject out-of-range port values with flag-named errors

Adds 1-65535 range checks to parsePort and envPort so values like 0,
-1, or 65536 fail with a flag/env-var-named ParseError instead of
reaching ensureValidPort with a generic 'backend port' label.

* test(cli): cover KANDEV_WEB_PORT happy path and range validation

* test(cli): cover KANDEV_WEB_PORT in run/start mode too

* fix(cli): explicit CLI flag wins over env var for port resolution

Previously KANDEV_BACKEND_PORT silently overrode --port because each
process port resolved its own env var before the generic --port
fallback. New precedence per process: explicit CLI flag > generic
--port flag > explicit env var > generic KANDEV_PORT. Also relabel
the startup info from "backend (api)" / "web (internal)" to plain
"backend" / "web" — "internal" was misleading in dev where the web
URL is what users open.

* style(cli): collapse resolvePorts comment to one line

* fix(cli): reject empty --version= and empty port env vars

- --version= (no value after =) now throws ParseError instead of
  silently storing the empty string as the version tag.
- envPort distinguishes unset (undefined) from empty (""); an empty
  KANDEV_PORT / KANDEV_BACKEND_PORT / KANDEV_WEB_PORT is now treated
  as misconfiguration and fails fast.

* refactor(cli): make --port a plain alias for --backend-port

Drops the command-aware split where --port mapped to web in dev and
backend in run/start. --port and --backend-port now both set
options.backendPort regardless of command, and KANDEV_PORT is a plain
fallback for KANDEV_BACKEND_PORT. The whole point of the original
fix was that the *backend port* is the URL users actually open in
run/start (because the Go server reverse-proxies Next.js); a single
flag that always means "the backend port" matches that mental model
without per-command surprises.

Removes deprecationReplacement and the command-aware warning logic
since the two flags are now interchangeable. --web-port → --web-internal-port
deprecation stays.

* test(cli): re-add KANDEV_WEB_PORT run-mode coverage dropped in refactor
2026-04-29 22:25:10 +01:00
Carlos Florêncio 183efad419 feat: expose MCP server to external coding agents (#732) 2026-04-29 10:37:44 +01:00
Carlos Florêncio 7076a40805 chore: change default ports to avoid common conflicts (#681) 2026-04-23 18:09:53 +01:00
Carlos Florêncio 31e45dcfec fix(cli): default dev mode db to <repo>/.kandev-dev/data (#664) 2026-04-20 22:49:26 +01:00
Carlos Florêncio c31fa98e61 fix(cli): detect standalone server.js at non-default path (#660) 2026-04-20 22:34:15 +01:00
Carlos Florêncio 814efdfa67 fix(cli): isolate dev mode state when running inside a kandev task (#617) 2026-04-17 19:41:29 +01:00
Carlos Florêncio 7ad7736e07 fix: move frontend off port 3000 and silence reverse-proxy panic logs (#568) 2026-04-09 18:50:43 +01:00
Carlos Florêncio 61bb7f0010 fix(cli): surface backend startup errors and extend health timeout (#561) 2026-04-08 19:28:53 +01:00
Carlos Florêncio c8efd31f06 fix(cli): respect KANDEV_DATABASE_PATH env var in dev mode (#548) 2026-04-06 13:33:07 +01:00
Carlos Florêncio b07356b29b feat(debug): enable pprof memory profiling in dev/debug mode (#518) 2026-04-01 23:21:29 +01:00
João Salavisa 56106b4906 fix(cli): add --debug/--verbose to run command and fix web hostname binding (#452) 2026-03-23 15:45:33 +00:00
Carlos Florêncio b48471e063 feat: single-port architecture and browser warning fixes (#390) 2026-03-08 13:10:39 +00:00
Carlos Florêncio 05ed43e8e0 feat: improve port forwarding, remote executor setup, and CLI port config (#388) 2026-03-08 11:03:30 +00:00
Carlos Florêncio 0da44478d1 feat: add port proxy, symlink file save fix, and remote executor improvements (#358) 2026-03-07 14:53:21 +00:00
Carlos Florêncio 87a4438037 fix: ui improvements for pr panel, git operations, and task sidebar (#359) 2026-03-03 22:52:47 +00:00
Carlos Florêncio 22c0fd2a57 fix: improve claude plan mode reliability and cleanup (#346) 2026-03-02 14:29:34 +00:00
Carlos Florêncio 9e995ba1b8 feat: add Dockerfile, K8s manifests, and deployment docs (#303) 2026-02-27 16:38:53 +00:00
Carlos Florêncio f19685dfa1 feat: improve cli startup wait 2026-02-25 09:49:04 +00:00
Carlos Florêncio 98330b05e4 feat: use github.com for releases instead of api to avoid rate limiting 2026-02-25 02:55:54 +00:00
Carlos Florêncio 3a95a43990 fix: vscode (#279) 2026-02-24 23:01:41 +00:00
Carlos Florêncio 332c3d8843 fix: make dev use local db (#276) 2026-02-24 18:31:12 +00:00
Carlos Florêncio 76c76e14d5 feat: add release version to cli 2026-02-24 11:14:04 +00:00
Carlos Florêncio 0d3f3b7727 feat: improve docker logging 2026-02-24 11:10:32 +00:00
Carlos Florêncio 61ef224ec7 style: fix format issues (#255) 2026-02-19 22:18:01 +00:00
Carlos Florêncio e74d20626d feat: improve backend handlers (#252) 2026-02-19 10:45:13 +00:00
Carlos Florêncio 613b063787 feat: use tar for bundles 2026-02-16 10:52:46 +00:00
Carlos Florêncio 95f1b2e13b fix: bundle 2026-02-15 23:38:08 +00:00
Carlos Florencio 1e54d3263d feat: improve windows support
release / build-web (push) Has been cancelled
release / build-bundles (aarch64-linux-gnu-gcc, arm64, linux, ubuntu-latest, linux-arm64) (push) Has been cancelled
release / build-bundles (amd64, darwin, macos-15-large, macos-x64) (push) Has been cancelled
release / build-bundles (amd64, linux, ubuntu-latest, linux-x64) (push) Has been cancelled
release / build-bundles (amd64, windows, windows-latest, windows-x64) (push) Has been cancelled
release / build-bundles (arm64, darwin, macos-14, macos-arm64) (push) Has been cancelled
2026-02-15 19:43:04 +00:00
Carlos Florêncio cebdda5d9f fix: sha lowercase comparison 2026-02-15 19:12:59 +00:00
Carlos Florêncio ae99a31a9f fix: github release download when github token is present 2026-02-15 19:12:02 +00:00
Carlos Florêncio 5197f041d6 feat: fix cli org 2026-02-15 18:55:43 +00:00
Carlos Florêncio cad2d783b3 feat: improve windows support (#225)
release / build-web (push) Has been cancelled
release / build-bundles (aarch64-linux-gnu-gcc, arm64, linux, ubuntu-latest, linux-arm64) (push) Has been cancelled
release / build-bundles (amd64, darwin, macos-13, macos-x64) (push) Has been cancelled
release / build-bundles (amd64, linux, ubuntu-latest, linux-x64) (push) Has been cancelled
release / build-bundles (amd64, windows, windows-latest, windows-x64) (push) Has been cancelled
release / build-bundles (arm64, darwin, macos-14, macos-arm64) (push) Has been cancelled
feat: windows support
2026-02-15 18:16:21 +00:00
Carlos Florêncio 6917b2bdcc fix: start ws disconnected 2026-02-08 21:01:09 +00:00
Carlos Florêncio 6baa7ffd55 feat: add ui debug on make start-debug 2026-02-08 19:17:35 +00:00
Carlos Florêncio b3cba6af00 fix: make start without public folder 2026-02-08 18:46:17 +00:00
Carlos Florêncio 8f2e2ff6b8 feat: add make start-debug 2026-02-08 12:27:38 +00:00
Carlos Florêncio 4d41155158 feat: mock agent (#208) 2026-02-07 17:48:04 +00:00
Carlos Florêncio 5f2be4e161 feat: fix random port (#202) 2026-02-06 22:35:39 +00:00
Carlos Florêncio 9b826363f3 fix: db path + open workspace folder (#169) 2026-02-03 22:07:41 +00:00
Carlos Florêncio 2d0985599a feat: improve make start 2026-02-03 09:50:43 +00:00
Carlos Florêncio 150c3f06c6 feat: session mobile design (#163)
fix: backend url
2026-02-03 03:38:15 +00:00
Carlos Florêncio 5c077062b2 feat: add make start (#151) 2026-02-02 16:35:47 +00:00
Carlos Florêncio ff4e0779d2 feat: improve make dev shutdown (#133) 2026-01-31 18:06:22 +00:00
Carlos Florêncio efd36ffbb7 feat: http logging middleware + mcp random port (#74) 2026-01-22 02:27:14 +00:00
Carlos Florêncio 535dee7ce0 feat: cli publish (#40) 2026-01-18 21:04:48 +00:00
Carlos Florêncio bc6a5f28d9 feat: cli launcher npx kandev (#39)
* feat: cli launcher

* feat: improved debug
2026-01-18 20:42:03 +00:00