본문으로 건너뛰기
cccskills
무료GitHub에 공개

neru-add-cli-command

Add a Neru CLI command or flag: cobra command in internal/cli, IPC handler in internal/app/ipcctrl, service/mode work behind it, man pages, and docs/reference/cli.md. Use when adding or changing user-facing commands, subcommands, or flags. Not for config.toml options.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

y3owk1n/neru스타 873(GitHub 873 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md3.7 KB
  • agents/openai.yaml298 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Adding a CLI command to Neru

Neru is a daemon plus a thin CLI. Almost every command serializes an IPC request to the running daemon over its per-user Unix socket or Windows named pipe. A new command therefore touches three layers plus docs. Skipping the IPC layer and calling app code directly from internal/cli is wrong even when it compiles.

The chain

  1. Cobra command in internal/cli/<name>.go, registered in an init() like its siblings. Mode-shaped commands (hints/grid/scroll variants) go through BuildModeCommand(ModeConfig{...}) in command_builders.go instead of hand-rolling cobra. Look at hints.go first. Long help text follows the house style: prose, then flag explanations, then an Examples: block.
  2. IPC transport is already generic (internal/adapter/ipc), so you only add an action string. Keep the wire shape in one place and reuse existing request helpers in internal/cli/cliutil.
  3. IPC handler in internal/app/ipcctrl. Handlers register into Controller.Handlers via the sub-controller for their family (lifecycle, modes, actions, info, overlay, scroll, …). Extend the matching RegisterHandlers, and don't add a case to the controller.
  4. The actual work lives in internal/app/services/* or a mode, never in the handler. Handlers parse, delegate, and shape the ipc.Response.
  5. Man pages: regenerate with just genman (backed by ./cmd/genman). Cobra metadata is the source, so if the man page reads wrong, fix the command's Short/Long, not the output.
  6. Docs: update docs/reference/cli.md. It is the single home for CLI reference facts.
  7. IPC reference: a new IPC command gets a row in the Commands table of docs/reference/ipc.md. internal/architecture/ipc_reference_test.go fails while the table and the commands the daemon answers differ.
  8. Schemas: when a reply type changes, run just genschema. internal/architecture/ipc_schema_test.go fails while schemas/ipc.schema.json is out of date.

Mode flags are different

A flag on a mode command (hints --action left_click) is not registered by hand. It is one entry in the descriptor table in internal/domain/modecmd, carrying its own parse, its own render, and the modes that accept it. That entry is what offers the flag on the command line, what the daemon and the config validator read it with, and what writes its row in the reference.

After adding, removing or re-wording one, run just genflagref to rewrite the generated region of docs/reference/cli.md. An architecture test (internal/architecture/mode_flag_contract_test.go) fails while a descriptor is unregistered or missing from that region, and while a mode command offers a flag the table never declared.

Tests

  • Command wiring and flag parsing: follow the table-driven patterns in internal/cli/cli_test.go / *_internal_test.go.
  • Handler behavior: internal/app/ipcctrl/*_test.go with port mocks from internal/ports/mocks. Assert the response shape and that the right service call happened, not internals.
  • Anything platform-gated must degrade with derrors.CodeNotSupported, and a contract test pins that (root AGENTS.md, "Hard rules").

Verify

just build
./bin/neru <command> --help     # against a running daemon: ./bin/neru launch
just genman

Then the standard pre-commit gate from AGENTS.md.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Add or change a Neru config.toml option end to end: struct field, shared and platform defaults, validation, examples, docs, and hot-reload behavior. Use whenever a change adds, renames, or removes a key in the TOML config schema. Not for theme palette entries or CLI flags.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

y3owk1n/neru8732026년 10월 26일 업데이트

Implement or stub Neru functionality for a specific OS/backend: port contract, build-tagged file slots, factory wiring, CodeNotSupported stubs, capability matrix, contract tests, and the docs ownership table. Use for any change under internal/adapter/platform or any *_darwin/_linux/_windows file. Not for pure-Go domain logic.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

y3owk1n/neru8732026년 10월 26일 업데이트

neru-ask

무료

Answer a Neru user's question about what Neru does, which command, flag, or config key does a thing, why something does not work, or what to try next, from the help, man pages, and docs of their installed version rather than from memory. Routes config work to neru-setup-config. Use when a Neru user asks what Neru can do, how to do something with it, which command to run, why hints or a hotkey do nothing, or which skill to use.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

y3owk1n/neru8732026년 10월 26일 업데이트

Help a Neru user build a tool on top of Neru, such as a status bar, a launcher, voice control, a companion UI, automation from another hotkey tool, a Go program, or a client for the IPC socket in another language. Picks the interface, checks the installed version has it, reads the contract from that version's docs, and runs the result against the live daemon. Routes config and hooks work to neru-setup-config. Use when a Neru user wants to script Neru, read its state, follow its events, drive it from another program, or write code against its CLI, socket, or Go client.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

y3owk1n/neru8732026년 10월 26일 업데이트

Commit working changes and open a Neru pull request the maintainer's way: conventional commit subjects, a PR title written for the changelog, the just ci gate, and the repo PR template filled honestly. Use when asked to commit, create a PR, open a pull request, or ship finished work in this repo.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

y3owk1n/neru8732026년 10월 26일 업데이트

File a Neru bug report or feature request that matches the repo's issue forms: duplicate check first, every required field filled with real diagnostics, correct labels. Use when asked to open, file, or draft a GitHub issue for Neru. Not for pull requests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

y3owk1n/neru8732026년 10월 26일 업데이트

y3owk1n의 스킬 모두 보기

이 스킬의 문제 신고