yjcli 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. {yjcli-0.1.2 → yjcli-0.1.4}/PKG-INFO +8 -3
  2. {yjcli-0.1.2 → yjcli-0.1.4}/README.md +7 -2
  3. {yjcli-0.1.2 → yjcli-0.1.4}/pyproject.toml +1 -1
  4. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/commands/sync.py +37 -2
  5. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-arch-core/SKILL.md +17 -6
  6. yjcli-0.1.4/src/yjcli/data/templates/platform/envs/app/.env.local-dev +3 -0
  7. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/listen/.env.local-dev +0 -1
  8. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/worker/.env.examples +4 -4
  9. yjcli-0.1.4/src/yjcli/data/templates/platform/envs/worker/.env.local-dev +3 -0
  10. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/frontend/vite.config.ts +1 -1
  11. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/services/scaffold.py +4 -2
  12. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/services/sync.py +2 -14
  13. yjcli-0.1.2/src/yjcli/data/templates/platform/envs/app/.env.local-dev +0 -4
  14. yjcli-0.1.2/src/yjcli/data/templates/platform/envs/worker/.env.local-dev +0 -4
  15. {yjcli-0.1.2 → yjcli-0.1.4}/.gitignore +0 -0
  16. {yjcli-0.1.2 → yjcli-0.1.4}/LICENSE +0 -0
  17. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/__init__.py +0 -0
  18. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/__main__.py +0 -0
  19. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/cli.py +0 -0
  20. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/commands/__init__.py +0 -0
  21. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/commands/init_cmd.py +0 -0
  22. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/commands/platform.py +0 -0
  23. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/commands/service.py +0 -0
  24. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/__init__.py +0 -0
  25. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-backend-msa/SKILL.md +0 -0
  26. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-backend-service/SKILL.md +0 -0
  27. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-browser-extension/SKILL.md +0 -0
  28. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-cli/SKILL.md +0 -0
  29. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-frontend/SKILL.md +0 -0
  30. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-mobile-app/SKILL.md +0 -0
  31. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/skills/yj-pc-app/SKILL.md +0 -0
  32. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/.gitignore +0 -0
  33. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/AGENTS.md +0 -0
  34. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/Makefile +0 -0
  35. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/TOOLS.md +0 -0
  36. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/make.bat +0 -0
  37. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/app/.env.development +0 -0
  38. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/app/.env.examples +0 -0
  39. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/app/.env.production +0 -0
  40. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/listen/.env.development +0 -0
  41. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/listen/.env.examples +0 -0
  42. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/listen/.env.production +0 -0
  43. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/worker/.env.development +0 -0
  44. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/envs/worker/.env.production +0 -0
  45. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/frontend/package.json +0 -0
  46. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/scripts/run.bat +0 -0
  47. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/platform/scripts/run.sh +0 -0
  48. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/data/templates/settings.json +0 -0
  49. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/modules/__init__.py +0 -0
  50. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/modules/constants.py +0 -0
  51. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/modules/fsutil.py +0 -0
  52. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/modules/paths.py +0 -0
  53. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/modules/prompt.py +0 -0
  54. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/services/__init__.py +0 -0
  55. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/services/status.py +0 -0
  56. {yjcli-0.1.2 → yjcli-0.1.4}/src/yjcli/services/wiring.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yjcli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Scaffold platforms, services, and AI agent wiring (Cursor/Claude/Codex) for YJ architecture repos.
5
5
  Project-URL: Homepage, https://github.com/yseiren87/yjcli
6
6
  Project-URL: Repository, https://github.com/yseiren87/yjcli
@@ -92,6 +92,10 @@ Operating rules (skill routing, output discipline) are in `AGENTS.md` — not in
92
92
 
93
93
  Platform targets are discovered from `*/scripts/run.sh` (after `init` / `platform add`).
94
94
  Each service declares its local command as `RUN_COMMAND` in `.env.local-dev`.
95
+ New services include `.env.local-dev`, `.env.development`, `.env.production`, and
96
+ `.env.examples`. Only `.env.local-dev` and `.env.examples` are required;
97
+ development/production may be removed and other `.env.<environment>` files may
98
+ be added. Commit `.env.examples` only.
95
99
  The platform runner executes that repository-owned declaration instead of
96
100
  inferring npm, uv, Go, or another language/runtime from project manifests.
97
101
 
@@ -125,10 +129,11 @@ Edit `AGENTS.md` only; do not edit `CLAUDE.md` by hand. Use `migrate` when upgra
125
129
 
126
130
  - `platform add` only creates platform roots (no services, no skills/Makefile — use `service add` / `sync`).
127
131
  - `service add` needs the platform root first (`init` or `platform add`).
128
- - Non-interactive: pass `-t` / `--all` / `-p` / `-n` as needed.
132
+ - Non-interactive: pass `-t` / `--all` / `-p` / `-n` as needed, and pass
133
+ `--yes` for every `sync` command.
129
134
  - `doctor` checks the **installed package** assets, not your target repo.
130
135
  - `sync skills` / `sync all` remove legacy `.cursor/rules` and `.claude/rules` if present.
131
- - `sync migrate` also overwrites `AGENTS.md` from the package (destructive); requires `--yes` when non-interactive.
136
+ - `sync migrate` also overwrites `AGENTS.md` from the package (destructive).
132
137
 
133
138
  ## Commands
134
139
 
@@ -67,6 +67,10 @@ Operating rules (skill routing, output discipline) are in `AGENTS.md` — not in
67
67
 
68
68
  Platform targets are discovered from `*/scripts/run.sh` (after `init` / `platform add`).
69
69
  Each service declares its local command as `RUN_COMMAND` in `.env.local-dev`.
70
+ New services include `.env.local-dev`, `.env.development`, `.env.production`, and
71
+ `.env.examples`. Only `.env.local-dev` and `.env.examples` are required;
72
+ development/production may be removed and other `.env.<environment>` files may
73
+ be added. Commit `.env.examples` only.
70
74
  The platform runner executes that repository-owned declaration instead of
71
75
  inferring npm, uv, Go, or another language/runtime from project manifests.
72
76
 
@@ -100,10 +104,11 @@ Edit `AGENTS.md` only; do not edit `CLAUDE.md` by hand. Use `migrate` when upgra
100
104
 
101
105
  - `platform add` only creates platform roots (no services, no skills/Makefile — use `service add` / `sync`).
102
106
  - `service add` needs the platform root first (`init` or `platform add`).
103
- - Non-interactive: pass `-t` / `--all` / `-p` / `-n` as needed.
107
+ - Non-interactive: pass `-t` / `--all` / `-p` / `-n` as needed, and pass
108
+ `--yes` for every `sync` command.
104
109
  - `doctor` checks the **installed package** assets, not your target repo.
105
110
  - `sync skills` / `sync all` remove legacy `.cursor/rules` and `.claude/rules` if present.
106
- - `sync migrate` also overwrites `AGENTS.md` from the package (destructive); requires `--yes` when non-interactive.
111
+ - `sync migrate` also overwrites `AGENTS.md` from the package (destructive).
107
112
 
108
113
  ## Commands
109
114
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "yjcli"
3
- version = "0.1.2"
3
+ version = "0.1.4"
4
4
  description = "Scaffold platforms, services, and AI agent wiring (Cursor/Claude/Codex) for YJ architecture repos."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -6,6 +6,7 @@ from pathlib import Path
6
6
 
7
7
  import typer
8
8
 
9
+ from yjcli.modules.prompt import abort
9
10
  from yjcli.services import sync as sync_svc
10
11
 
11
12
  app = typer.Typer(
@@ -18,6 +19,26 @@ app = typer.Typer(
18
19
  )
19
20
 
20
21
 
22
+ def _confirm_sync(*, yes: bool, target: str) -> bool:
23
+ if yes:
24
+ return True
25
+ while True:
26
+ try:
27
+ answer = typer.prompt(
28
+ f"{target} files will be overwritten. Continue? [y/n]",
29
+ default=None,
30
+ show_default=False,
31
+ ).strip().lower()
32
+ except (EOFError, typer.Abort):
33
+ abort("non-interactive stdin; pass --yes")
34
+ if answer == "y":
35
+ return True
36
+ if answer == "n":
37
+ typer.echo("sync cancelled.")
38
+ return False
39
+ typer.echo("Enter y or n.", err=True)
40
+
41
+
21
42
  @app.command("agents")
22
43
  def sync_agents(
23
44
  path: Path = typer.Option(
@@ -28,8 +49,11 @@ def sync_agents(
28
49
  dir_okay=True,
29
50
  resolve_path=True,
30
51
  ),
52
+ yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation."),
31
53
  ) -> None:
32
54
  """Overwrite CLAUDE.md from AGENTS.md (edit AGENTS.md only)."""
55
+ if not _confirm_sync(yes=yes, target="Agent mirror"):
56
+ return
33
57
  sync_svc.sync_agents(path)
34
58
 
35
59
 
@@ -43,8 +67,11 @@ def sync_skills(
43
67
  dir_okay=True,
44
68
  resolve_path=True,
45
69
  ),
70
+ yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation."),
46
71
  ) -> None:
47
72
  """Overwrite .cursor/.claude/.agents skills from the yjcli package."""
73
+ if not _confirm_sync(yes=yes, target="Skill"):
74
+ return
48
75
  sync_svc.sync_skills(path, force=True)
49
76
 
50
77
 
@@ -58,8 +85,11 @@ def sync_make(
58
85
  dir_okay=True,
59
86
  resolve_path=True,
60
87
  ),
88
+ yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation."),
61
89
  ) -> None:
62
90
  """Overwrite root Makefile/make.bat and installed platforms' run.sh/run.bat."""
91
+ if not _confirm_sync(yes=yes, target="Make and run script"):
92
+ return
63
93
  sync_svc.sync_make(path, force=True)
64
94
 
65
95
 
@@ -73,11 +103,14 @@ def sync_all(
73
103
  dir_okay=True,
74
104
  resolve_path=True,
75
105
  ),
106
+ yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation."),
76
107
  ) -> None:
77
108
  """Sync AGENTS.md → CLAUDE.md, skills, make files, and platform run scripts.
78
109
 
79
110
  Does not overwrite AGENTS.md from the package (use `sync migrate` for that).
80
111
  """
112
+ if not _confirm_sync(yes=yes, target="Agent mirror, skill, make, and run script"):
113
+ return
81
114
  sync_svc.sync_all(path, force=True)
82
115
 
83
116
 
@@ -95,7 +128,7 @@ def sync_migrate(
95
128
  False,
96
129
  "--yes",
97
130
  "-y",
98
- help="Skip confirmation (required when stdin is not a TTY).",
131
+ help="Skip confirmation.",
99
132
  ),
100
133
  ) -> None:
101
134
  """Force-replace agent wiring from the package (destructive upgrade).
@@ -104,4 +137,6 @@ def sync_migrate(
104
137
  Makefile/make.bat, platform run scripts, TOOLS.md, .gitignore,
105
138
  .claude/settings.json. Removes legacy .cursor/rules, .claude/rules, .agent.
106
139
  """
107
- sync_svc.sync_migrate(path, yes=yes)
140
+ if not _confirm_sync(yes=yes, target="Agent wiring and root template"):
141
+ return
142
+ sync_svc.sync_migrate(path)
@@ -53,18 +53,29 @@ browser-extension/ # yj-browser-extension
53
53
 
54
54
  ## Environment (guardrails only)
55
55
 
56
- Allowed files at each service root (no plain `.env`):
56
+ Required files at each service root (no plain `.env`):
57
57
 
58
- `.env.local-dev` · `.env.development` · `.env.production` · `.env.examples`
58
+ `.env.local-dev` · `.env.examples`
59
59
 
60
- - Do not invent alternate names (including Vite `.env` / `.env.local`) unless a thin loader maps to this set.
60
+ - New services also start with `.env.development` and `.env.production`, but these
61
+ are optional. Remove them when unused or add environments such as `.env.staging`,
62
+ `.env.test`, or `.env.qa` as the project requires. Environment files must follow
63
+ the `.env.<environment>` naming pattern; do not use plain `.env` or Vite's
64
+ `.env.local` convention unless a thin loader maps it to this structure.
61
65
  - Env field sets come from `templates/platform/envs/<kind>/` via platform mapping (`listen` / `worker` / `app`).
62
66
  - `listen`: `backend` (PORT 8080), `frontend` (PORT 5173)
63
- - `worker`: `backend-service`, `browser-extension/native_*` (HOST/PORT optional comments)
67
+ - `worker`: `backend-service`, `browser-extension/native_*` (HOST/PORT optional)
64
68
  - `app`: `cli`, `mobile-app`, `pc-app`, `browser-extension` (NAME/VERSION only)
65
- Do not invent fields/filenames outside those templates.
69
+ Do not invent fields outside those templates; environment filenames remain
70
+ extensible through the `.env.<environment>` pattern above.
66
71
  - `HOST`/`PORT` are required for `listen`. For `worker` they are optional — add only if needed.
67
- - Commit `.env.examples` only; never commit the other three.
72
+ - `.env.examples` is the committed field contract. Format every entry as one
73
+ comment line followed by one empty `FIELD=` line, with one blank line between
74
+ entries.
75
+ - Every other `.env.<environment>` file lists populated `FIELD=value` lines
76
+ consecutively, without field-description comments or separator blank lines.
77
+ - Commit `.env.examples` only; never commit `.env.local-dev` or any other
78
+ environment value file.
68
79
  - Local platform `run.*` uses `.env.local-dev` only — do not hardcode HOST/PORT in scripts.
69
80
  - Each service declares its repository-owned local `RUN_COMMAND` in `.env.local-dev`.
70
81
  Platform `run.*` must execute that declaration and must not infer commands from
@@ -0,0 +1,3 @@
1
+ NAME=__NAME__
2
+ VERSION=0.1.0
3
+ RUN_COMMAND=""
@@ -2,5 +2,4 @@ NAME=__NAME__
2
2
  VERSION=0.1.0
3
3
  HOST=127.0.0.1
4
4
  PORT=__PORT__
5
- # Repository-owned local command; quote values containing spaces.
6
5
  RUN_COMMAND=""
@@ -4,11 +4,11 @@ NAME=
4
4
  # Semver or build version
5
5
  VERSION=
6
6
 
7
- # Optional listen bind (add only when this service exposes a port)
8
- # HOST=
7
+ # Optional listen bind
8
+ HOST=
9
9
 
10
- # Optional listen port (add only when this service exposes a port)
11
- # PORT=
10
+ # Optional listen port
11
+ PORT=
12
12
 
13
13
  # Local command used only by platform scripts/run.* (.env.local-dev)
14
14
  RUN_COMMAND=
@@ -0,0 +1,3 @@
1
+ NAME=__NAME__
2
+ VERSION=0.1.0
3
+ RUN_COMMAND=""
@@ -1,7 +1,7 @@
1
1
  import { defineConfig, loadEnv } from "vite";
2
2
  import react from "@vitejs/plugin-react";
3
3
 
4
- // Env files (yj-arch-core): .env.local-dev | .env.development | .env.production
4
+ // Env files (yj-arch-core): required .env.local-dev plus optional .env.<environment> files.
5
5
  // Loaded via Vite --mode (no plain .env).
6
6
  // Platform run.* always exports values from .env.local-dev before RUN_COMMAND.
7
7
 
@@ -19,7 +19,9 @@ from yjcli.modules.prompt import abort, select_existing_platform, select_platfor
19
19
  from yjcli.services import wiring
20
20
 
21
21
  _SERVICE_NAME_RE = re.compile(r"^[A-Za-z0-9_][A-Za-z0-9_-]*$")
22
- _ENV_FILE_NAMES = (
22
+ # New services start with these files. Projects may remove development/production
23
+ # or add other .env.<environment> files; examples and local-dev remain required.
24
+ _DEFAULT_ENV_FILE_NAMES = (
23
25
  ".env.local-dev",
24
26
  ".env.development",
25
27
  ".env.production",
@@ -77,7 +79,7 @@ def _copy_env_templates(platform: str, name: str, dest: Path) -> None:
77
79
  abort(f"missing env template dir: {src}")
78
80
 
79
81
  replace = {"__NAME__": name, **extra}
80
- for filename in _ENV_FILE_NAMES:
82
+ for filename in _DEFAULT_ENV_FILE_NAMES:
81
83
  file = src / filename
82
84
  if not file.is_file():
83
85
  abort(f"missing env template: {file}")
@@ -9,7 +9,7 @@ import typer
9
9
 
10
10
  from yjcli.modules import paths
11
11
  from yjcli.modules.constants import PLATFORMS
12
- from yjcli.modules.fsutil import copy_file, copy_tree, ensure_real_dir, is_interactive
12
+ from yjcli.modules.fsutil import copy_file, copy_tree, ensure_real_dir
13
13
  from yjcli.modules.prompt import abort
14
14
 
15
15
  _SKILL_DEST_RELS = (
@@ -114,25 +114,13 @@ def sync_all(root: Path, *, force: bool = True) -> None:
114
114
  sync_make(root, force=force)
115
115
 
116
116
 
117
- def sync_migrate(root: Path, *, yes: bool = False) -> None:
117
+ def sync_migrate(root: Path) -> None:
118
118
  """Force-replace agent wiring + root templates from the package (destructive).
119
119
 
120
120
  Unlike `sync all`, this overwrites `AGENTS.md` from the package template,
121
121
  wipes skill directories (drops stale skills), removes legacy rules / `.agent`,
122
122
  and refreshes Claude settings + TOOLS.md / .gitignore / make scripts.
123
123
  """
124
- if not yes:
125
- if not is_interactive():
126
- abort("migrate requires --yes in non-interactive mode")
127
- answer = typer.prompt(
128
- "migrate overwrites AGENTS.md, skills, Makefile, TOOLS.md, "
129
- ".gitignore, .claude/settings.json; removes legacy rules/.agent. "
130
- "Continue? [y/N]",
131
- default="N",
132
- )
133
- if answer.strip().lower() not in {"y", "yes"}:
134
- abort("migrate cancelled")
135
-
136
124
  typer.echo("== migrate: strip legacy ==")
137
125
  _remove_legacy_rules_dirs(root)
138
126
  _remove_path(root, Path(".agent"), label="legacy")
@@ -1,4 +0,0 @@
1
- NAME=__NAME__
2
- VERSION=0.1.0
3
- # Repository-owned local command; quote values containing spaces.
4
- RUN_COMMAND=""
@@ -1,4 +0,0 @@
1
- NAME=__NAME__
2
- VERSION=0.1.0
3
- # Repository-owned local command; quote values containing spaces.
4
- RUN_COMMAND=""
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes