Skip to content

Improve CLI output format for documentation readability #89

@em3s

Description

@em3s

Background

The CLI internally uses the REST API, and we want users to understand this—it helps them see that everything the CLI does, they can do via HTTP.

The current output format doesn't translate well to documentation. In markdown, HTTP logs and results blend together:

actionbase(likes:likes)> get --source Alice --target Phone
[2026-01-20 20:46:17][DEBUG] GET /graph/v3/databases/likes/tables/likes/edges/get?source=Alice&target=Phone
[2026-01-20 20:46:17][DEBUG] 200 OK
 {"edges":[{"version":1768909550245,"source":"Alice","target":"Phone",...}],"count":1,...}

The edge is found: [Alice -> Phone]
|---------------|--------|--------|---------------------------|
...

Task

  • Replace [timestamp][DEBUG] with , use / for request/response
  • Truncate JSON response to ~60 chars
  • Support use database and use table in preset

Target output:

actionbase> load preset likes
...
1. Database 'likes' created
2. Table 'likes' created
3. 3 edges inserted (Alice -> Phone, Alice -> Laptop, Bob -> Phone)
4. Database changed to 'likes'
5. Table changed to 'likes'

actionbase(likes:likes)> get --source Alice --target Phone
  │ → GET /graph/v3/.../edges/get?source=Alice&target=Phone
  │ ← 200 OK {"edges":[{"version":1768909550245,"source":"Al...

The edge is found: [Alice -> Phone]
|---------------|--------|--------|---------------------------|
...

Done When

  • HTTP logs visually distinct via prefix and indentation
  • load preset likes sets database/table context automatically

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestscope:cliCommand-line interface (Go)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions