Commit graph

19 commits

Author SHA1 Message Date
ZTatman
4c99fe71fa refactor(cli): simplify verify, improve error messages, use env var names
- Use ENV_MAPPING from config.ts instead of inline object
- Display env var names (SNAKE_CASE) not internal keys
- Remove 'set' verbiage from display output
- Improve forgejo-checks error messages with actionable descriptions
- Fix tsconfig composites causing build issues
2026-04-13 12:47:57 -04:00
ZTatman
8a716964bb refactor: clean up dead code and redundant checks 2026-04-12 23:10:10 -04:00
ZTatman
177c724fdf fix(cli): show option descriptions in help output and move verify under config 2026-04-12 23:07:34 -04:00
ZTatman
6588fad461 refactor(verify): simplify by extracting functions and removing duplication 2026-04-12 23:06:17 -04:00
ZTatman
18d3b175de fix(verify): simplify missing config detection
- Use REQUIRED_KEYS directly instead of complex mapping lookup
- KISS: simpler code that's easier to understand
2026-04-12 22:43:43 -04:00
ZTatman
9647f27db4 fix(cli): simplify path derivation for --output flag
- Remove unused outDir variable
- Directly use opts.output or default to cwd/.env
2026-04-12 18:29:51 -04:00
ZTatman
134d5ff8c7 fix(cli): handle help flag as subcommand parameter more explicitly
- Convert help flags to undefined before passing to showCommandHelp
- Improves semantic clarity when user runs 'myst config --help'
2026-04-12 18:28:32 -04:00
ZTatman
55d45adec8 fix(cli): replace process.exit(0) with proper exit handling
- Use process.exitCode + return in select cancel path
- Use process.exitCode + throw in group onCancel handler
- Allows finally blocks to run for cleanup
2026-04-12 18:22:06 -04:00
ZTatman
a7f30a0d3a docs: update README with current CLI commands
- Replace myst init with myst config init
- Replace myst forgejo bootstrap with myst verify
- Replace myst doctor with myst verify --diagnostic
- Replace myst config print with myst config view
2026-04-12 18:19:55 -04:00
ZTatman
099d521288 refactor: simplify .env generation and remove unnecessary escaping
- Remove escapeEnvValue function (no longer needed)
- Simplify generateEnvFile to write plain KEY=value format
- Remove quote-stripping from parseEnvFile
- Move helper functions back to module level for cleaner code
- Use DATABASE_PROTOCOLS in validateDatabaseUrl
2026-04-12 18:13:16 -04:00
ZTatman
a4ee1d95dc fix(cli): add default timeout to forgejo api check fetch requests 2026-04-12 17:42:46 -04:00
ZTatman
d6b9677ca5 refactor(cli): restructure CLI with new command router and merge verify/doctor
- Replace custom argument parsing with generic cli-router
- Add subcommand support (myst config init, myst config view)
- Merge verify and doctor into single command with --diagnostic flag
- Extract shared forgejo-checks to utils
- Remove unused code (generatePassword, EnvKey/ConfigKey types)
- Add dynamic package.json for help/version display
2026-04-11 22:16:22 -04:00
ZTatman
6884dffda6 refactor: consolidate env config into single config.ts
- Create single packages/cli/src/config.ts with:
  - MystEnvironmentVariables interface
  - ENV_MAPPING constant
  - REQUIRED_KEYS constant
  - parseEnvFile()
  - validateDatabaseUrl()
  - generateEnvFile()

- Remove duplicates:
  - constants.ts (absorbed)
  - utils/config.ts (absorbed)
  - utils/env.ts (absorbed)

- Update command files to import from config.ts
2026-04-11 18:34:49 -04:00
ZTatman
a3c202a662 feat(cli): add config print, verify, and doctor commands for config validation
- myst config print: show current config with redacted secrets
- myst verify: verify Forgejo connectivity and API token
- myst doctor: comprehensive validation of config and connectivity
- add start script to service package.json
2026-04-09 20:40:55 -04:00
ZTatman
31c3105e34 remove myst.config.json generation, rely on .env for container deployments 2026-04-08 14:52:11 -04:00
ZTatman
f1a4a6d18c refactor: use parseArgs from node:util to do basic parsing 2026-04-08 14:40:49 -04:00
ZTatman
c4c41e0e31 refactor(cli): move help related functions to help.ts to keep
cli/src/index.ts entry point narrow
2026-04-08 10:28:59 -04:00
ee85b079ad
Phase 1: CLI init skeleton and deployment plan (#5)
* Add CLI scaffold and config generators

* Add PR stacking note to README

* refactor: write embargo init command myself for clarity

* refactor: rename Myst and narrow CLI setup flow

* Update Phase 1 plans with finalized design decisions

Major updates:
- Add authentication model (Forgejo sessions for identity, PAT for data access)
- Add link types (private email-verified, public time-expired)
- Add link creation rules (owner-only)
- Add Docker/deployment guidance (Dockerfile only, Dokploy handles orchestration)
- Add database model (separate DBs on same PostgreSQL instance)
- Add viewer baseline and user dashboard sections
- Add SMTP configuration via post-login setup page

Key architectural decisions:
- Users log in via Forgejo session, no separate Myst login
- Service account PAT used for API calls, not user identity
- Private links require email verification code
- Public links are time-expired for job applications
- Myst provides Dockerfile, operators use Dokploy for deployment

* Complete CLI init skeleton with CodeRabbit review fixes

CLI changes:
- Narrow init to Myst-only config generation (no Forgejo provisioning)
- Add yoctocolors styling to CLI output
- Simplify URL validation logic (remove dead code)
- Fix typo in env.ts comment
- Remove docker-compose generator (out of scope)
- Move example config from src/ to packages/cli/examples/
- Fix CommandName type to match implemented commands only

Config changes:
- Remove databaseUrl from myst.config.json (DB is .env-only)
- Update example config with current fields
- Reject non-HTTP schemes before auto-prepending https://
- Use localhost -> 127.0.0.1 in Caddy/Nginx examples
- Add file existence checks and 0o600 permissions

Build passes after all changes.

* docs: rewrite README with Myst branding and architecture

- Add Mermaid architecture diagram
- Document two link types (private/public)
- Explain authentication model
- Provide setup steps
- Add example configuration
- Include Phase 1 completion checklist

* fix: correct Mermaid diagram syntax

* refactor: streamline README per create-readme skill guidelines

- Use blockquote for tagline
- Simplify architecture diagram labels
- Remove redundant sections (Setup, Example Config, License)
- Keep checklist as primary tracking mechanism
- Use tables for features and auth
- Reduce verbosity throughout

* cli: add preflight check and version flag

- Add preflightWriteTargets to check file existence before writing
- Remove stub commands (start, stop, status) from help text
- Add --version flag support
- Sequential file writes with preflight check

* cleanup: remove empty command stubs and test config

- Remove start.ts, stop.ts, status.ts (not implemented yet)
- Remove myst.config.json (generated during testing)

* cleanup: remove app-ini generator (Forgejo provisioning out of scope)

* cleanup: remove empty unused utility files (docker.ts, flags.ts, init.ts)

* cleanup: remove examples.ts (examples belong in docs, not deployed code)

* Docs: clarify Forgejo user PAT wording (#4)

* Docs: add diagram slot and clarify deployment examples (#6)

* docs: rename Forgejo bot configuration

* refactor(cli): improve init command error handling; change "service
account" verbaige to "dedicated forgejo user" to match Forgejo user
model;
2026-04-07 13:27:19 -04:00
ZTatman
b22d46ff84 Bootstrap pnpm monorepo workspace 2026-03-30 16:32:04 -04:00