Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gesttalt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: jdx/mise-action@v2

- name: Check formatting
run: zig fmt --check src/
run: find src -name '*.zig' -not -path 'src/templates/*' -print0 | xargs -0 zig fmt --check

build:
name: Build (${{ matrix.target }})
Expand Down
251 changes: 251 additions & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,257 @@ gesttalt snippets <subcommand> [OPTIONS]
- `-b, --body <STR>` - Snippet body (env: `GESTTALT_SNIPPET_BODY`)
- `-f, --filename <STR>` - Display filename (env: `GESTTALT_SNIPPET_FILENAME`)

#### `gesttalt post`

Manage blog posts.

**Usage:**
```bash
gesttalt post <command> [OPTIONS]
```

**Commands:**
- `create` - Create a new blog post
- `list` - List blog posts
- `read` - Read a blog post
- `update` - Update a blog post
- `delete` - Delete a blog post

##### `gesttalt post create`

Create a new blog post.

**Usage:**
```bash
gesttalt post create <slug> [OPTIONS]
```

**Options:**
- `--title <TITLE>` - Post title (required)
- `--description <DESCRIPTION>` - Post description (required)
- `--tags <TAG1,TAG2>` - Comma-separated tags (optional)
- `--date <YYYY-MM-DD>` - Publication date (default: today)
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_POST_TITLE` - Post title
- `GESTTALT_POST_DESCRIPTION` - Post description
- `GESTTALT_POST_TAGS` - Comma-separated tags
- `GESTTALT_POST_DATE` - Publication date
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

**Behavior:**
- Creates `content/blog/YYYY/MM/DD/`
- Creates `<slug>.md` with TOML frontmatter
- Opens the file in `$EDITOR` when available

##### `gesttalt post list`

List blog posts.

**Usage:**
```bash
gesttalt post list [OPTIONS]
```

**Options:**
- `--format <FORMAT>` - Output format: `table`, `json`, `csv`, `toon` (default: `table`)
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_POST_LIST_FORMAT` - Output format
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

**Formats:**
- `toon` - Newline-delimited JSON objects (one post per line)

##### `gesttalt post read`

Read a blog post by slug.

**Usage:**
```bash
gesttalt post read <slug> [OPTIONS]
```

**Options:**
- `--format <FORMAT>` - Output format: `markdown`, `json` (default: `markdown`)
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_POST_READ_FORMAT` - Output format
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

##### `gesttalt post update`

Update a blog post by slug.

**Usage:**
```bash
gesttalt post update <slug> [OPTIONS]
```

**Options:**
- `--title <TITLE>` - Update title
- `--description <DESCRIPTION>` - Update description
- `--tags <TAG1,TAG2>` - Replace tags
- `--add-tags <TAG1,TAG2>` - Add tags
- `--remove-tags <TAG1,TAG2>` - Remove tags
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_POST_TITLE` - Update title
- `GESTTALT_POST_DESCRIPTION` - Update description
- `GESTTALT_POST_TAGS` - Replace tags
- `GESTTALT_POST_ADD_TAGS` - Add tags
- `GESTTALT_POST_REMOVE_TAGS` - Remove tags
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

##### `gesttalt post delete`

Delete a blog post by slug.

**Usage:**
```bash
gesttalt post delete <slug> [OPTIONS]
```

**Options:**
- `-f, --force` - Skip confirmation prompt
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_POST_FORCE` - Skip confirmation prompt
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

#### `gesttalt note`

Manage notes.

**Usage:**
```bash
gesttalt note <command> [OPTIONS]
```

**Commands:**
- `create` - Create a new note
- `list` - List notes
- `read` - Read a note
- `update` - Update a note
- `delete` - Delete a note

##### `gesttalt note create`

Create a new note.

**Usage:**
```bash
gesttalt note create [OPTIONS]
```

**Options:**
- `-t, --timestamp <I64>` - Unix timestamp (default: now)
- `--slug <STR>` - Slug override (optional)
- `--body <STR>` - Note body (optional)
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_NOTE_TIMESTAMP` - Unix timestamp
- `GESTTALT_NOTE_SLUG` - Slug override
- `GESTTALT_NOTE_BODY` - Note body
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

**Behavior:**
- Creates `content/notes/{timestamp}.md`
- Writes optional TOML frontmatter for the slug override
- Opens the file in `$EDITOR` when no body is provided

##### `gesttalt note list`

List notes.

**Usage:**
```bash
gesttalt note list [OPTIONS]
```

**Options:**
- `--format <FORMAT>` - Output format: `table`, `json`, `csv`, `toon` (default: `table`)
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_NOTE_LIST_FORMAT` - Output format
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

**Formats:**
- `toon` - Newline-delimited JSON objects (one note per line)

##### `gesttalt note read`

Read a note by id (timestamp or slug).

**Usage:**
```bash
gesttalt note read <id> [OPTIONS]
```

**Options:**
- `--format <FORMAT>` - Output format: `markdown`, `json` (default: `markdown`)
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_NOTE_READ_FORMAT` - Output format
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

##### `gesttalt note update`

Update a note by id (timestamp or slug).

**Usage:**
```bash
gesttalt note update <id> [OPTIONS]
```

**Options:**
- `--slug <STR>` - Update slug
- `--clear-slug` - Remove slug override
- `--body <STR>` - Update body
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_NOTE_SLUG` - Update slug
- `GESTTALT_NOTE_CLEAR_SLUG` - Remove slug override
- `GESTTALT_NOTE_BODY` - Update body
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)

##### `gesttalt note delete`

Delete a note by id (timestamp or slug).

**Usage:**
```bash
gesttalt note delete <id> [OPTIONS]
```

**Options:**
- `-f, --force` - Skip confirmation prompt
- `-d, --dir <DIR>` - Project directory (default: current directory)
- `-h, --help` - Display help message

**Environment Variables:**
- `GESTTALT_NOTE_FORCE` - Skip confirmation prompt
- `GESTTALT_DIR` - Project directory (overridden by `--dir`)


### Global Options

```bash
Expand Down
2 changes: 2 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub fn build(b: *std.Build) void {
},
}),
});
lib_tests.linkLibC();
const run_lib_tests = b.addRunArtifact(lib_tests);

const exe_tests = b.addTest(.{
Expand All @@ -90,6 +91,7 @@ pub fn build(b: *std.Build) void {
},
}),
});
exe_tests.linkLibC();
const run_exe_tests = b.addRunArtifact(exe_tests);

const test_step = b.step("test", "Run unit tests");
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.{
.name = .gesttalt,
.version = "0.1.0",
.fingerprint = 0xd40e2bbb31f5f844,
.fingerprint = 0xd40e2bbb254b513f,
.minimum_zig_version = "0.15.0",
.paths = .{
"build.zig",
Expand Down
Loading