Skip to content

feat: redesign command hierarchy into Daily Use and Low-level API tiers - #13

Merged
Leechael merged 19 commits into
mainfrom
feat/command-layering
Jun 19, 2026
Merged

feat: redesign command hierarchy into Daily Use and Low-level API tiers#13
Leechael merged 19 commits into
mainfrom
feat/command-layering

Conversation

@Leechael

@Leechael Leechael commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix fenced code block parsing in save, including code fences inside list items.
  • Make get --plain preserve block hierarchy with indentation.
  • Add save --replace for replacing an existing page's content.
  • Add page clear and page delete commands.
  • Surface help topics from save --help and keep help topic names registered.

Test plan

  • go test ./...
  • prek

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/roamresearch/references/usage-examples.md">

<violation number="1" location="skills/roamresearch/references/usage-examples.md:100">
P3: `q` is documented under Daily Use, but the skill’s tiering rules place `q` under Low-level API. This contradicts the two-tier model and can mislead users about intended usage.</violation>
</file>

<file name="internal/cmd/get.go">

<violation number="1" location="internal/cmd/get.go:39">
P2: `get` no longer rejects extra positional arguments, so calls like `get foo bar` are accepted and the second argument is silently ignored.</violation>
</file>

<file name="docs/help/topics/format.md">

<violation number="1" location="docs/help/topics/format.md:60">
P2: The documentation example uses malformed fenced-code delimiters (` ` ``) instead of valid triple backticks, so the sample input is not reproducible as a GFM code block.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread internal/cmd/get.go Outdated
Comment thread docs/help/topics/format.md Outdated
Comment thread skills/roamresearch/references/usage-examples.md

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/cmd/search.go">

<violation number="1" location="internal/cmd/search.go:70">
P2: `--limit 0` is documented as unlimited but block searches forcibly convert 0 to 20, causing unintended result truncation for `--type block`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread internal/cmd/search.go Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/help/topics/workflow-examples.md">

<violation number="1" location="docs/help/topics/workflow-examples.md:8">
P2: These `printf` examples are shell-invalid because the format string starts with `-`; use `printf '%s\n' '...'` (or `printf --`) so the commands run as documented.</violation>
</file>

<file name="docs/help/topics/write-examples.md">

<violation number="1" location="docs/help/topics/write-examples.md:28">
P2: Shell examples use `<uid>` which is parsed as input redirection, so copied commands won’t pass a UID argument. Use a shell-safe placeholder like "$UID" or UID_HERE instead.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread docs/help/topics/workflow-examples.md Outdated
Comment thread docs/help/topics/write-examples.md

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 14 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/roamresearch/references/usage-examples.md">

<violation number="1" location="skills/roamresearch/references/usage-examples.md:100">
P3: `q` is documented under Daily Use, but the skill’s tiering rules place `q` under Low-level API. This contradicts the two-tier model and can mislead users about intended usage.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread internal/format/markdown.go
Comment thread internal/format/gfm_to_roam.go Outdated
Comment thread README.md
Comment thread internal/format/markdown.go

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 12 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/cmd/page_test.go">

<violation number="1" location="internal/cmd/page_test.go:70">
P2: TestSavePlainOutputsCreatedBlockUID has unsafe t.Fatalf calls from handler goroutine and data race on shared variables sectionUID/contentUID</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread internal/cmd/page_test.go
@@ -0,0 +1,284 @@
package cmd

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: TestSavePlainOutputsCreatedBlockUID has unsafe t.Fatalf calls from handler goroutine and data race on shared variables sectionUID/contentUID

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/cmd/page_test.go, line 70:

<comment>TestSavePlainOutputsCreatedBlockUID has unsafe t.Fatalf calls from handler goroutine and data race on shared variables sectionUID/contentUID</comment>

<file context>
@@ -56,6 +56,60 @@ func readJSONBody(t *testing.T, r *http.Request) map[string]any {
+		case r.URL.Path == "/api/graph/test-graph/write":
+			actions := body["actions"].([]any)
+			if len(actions) != 3 {
+				t.Fatalf("expected create-page, section, and content actions, got %d", len(actions))
+			}
+			section := actions[1].(map[string]any)["block"].(map[string]any)
</file context>

Leechael added 16 commits June 19, 2026 02:16
Restructure CLI commands based on actual Roam user workflows. The most
frequent operation (writing to daily page sections) should be one command,
not a multi-step UID lookup chain.

Changes:
- Revert block create --today/--daily/--page (keep it low-level, UID-only)
- save --plain now outputs target UID for composability
- get: add --today and --daily flags for daily page access
- New top-level move command with name-based targeting (--title/--today/--under)
- Root --help groups commands into Daily Use and Low-level API sections
- New help topics: writing-guide (save vs block create decision tree) and
  format (GFM-to-Roam conversion rules)
- Rewrite help categories (read/write/workflow) with save as primary,
  printf|save pattern, TODO examples, move workflows
- Update SKILL.md: two-tier command table, strengthened anti-patterns,
  pipeline composability, move command docs
- Update usage-examples.md: reorganized by tier with new command examples
- Hide --token/--graph/--base-url/--timeout from root --help (still
  usable, documented in help topic)
- New help topic: configuration (credentials setup, 1Password CLI,
  API token instructions)
- Improve credential error message: points to "roam-cli help configuration"
  instead of raw env var names
Combine search and search-pages into a single search command with
--type page|block flag (default: page). Footer hints at the other
mode and pagination. Removes search-pages as a separate command.
…OPICS

Move read/write/workflow examples from hardcoded categories in help.go
to docs/help/topics/ markdown files. All help content is now managed as
topics, eliminating the duplicate "HELP TOPICS" and "Example categories"
sections in root --help output.
@Leechael
Leechael force-pushed the feat/command-layering branch from 4e27c73 to dff5bfb Compare June 18, 2026 18:21
@Leechael
Leechael merged commit 17558aa into main Jun 19, 2026
3 checks passed
@Leechael
Leechael deleted the feat/command-layering branch June 19, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant