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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: dorny/paths-filter@v3
id: filter
with:
token: '' # Forces git-based detection, bypasses GitHub API
filters: |
docs:
- 'docs/**'
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ walkdir = "2.5.0"
url = "2.5.8"
zip = "2.2"
rayon = "1.11.0"
similar = "2.7"

# Python interop
pyo3 = { version = "0.27.2", features = ["extension-module", "abi3-py39"] }
Expand Down Expand Up @@ -150,6 +151,7 @@ hex.workspace = true
rusqlite.workspace = true
opentelemetry-proto.workspace = true
prost.workspace = true
similar.workspace = true

[dev-dependencies]
tempfile = "3.15"
32 changes: 30 additions & 2 deletions docs/content/docs/reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,23 @@ uv run apx dev check [APP_PATH]

### dev apply

Apply an addon to an existing project.
Apply an addon to an existing project. Shows a diff of changes and asks for confirmation before applying.

```bash
uv run apx dev apply <ADDON>
uv run apx dev apply <ADDON> [OPTIONS] [APP_PATH]
```

#### Arguments

- `ADDON`: The addon to apply (see available addons below)
- `APP_PATH`: The path to the app (optional, defaults to current directory)

#### Options

| Option | Description |
| ----------- | --------------------------------------------------- |
| `-y, --yes` | Skip confirmation prompt and apply changes directly |

#### Available Addons

<Tabs items={["Assistant Rules", "Templates", "Layouts"]}>
Expand Down Expand Up @@ -245,6 +256,23 @@ uv run apx dev apply <ADDON>
</Tab>
</Tabs>

#### Example

```bash
# Apply Cursor rules with confirmation prompt
uv run apx dev apply cursor

# Apply stateful addon without confirmation
uv run apx dev apply stateful -y
```

The command will:

1. Show a list of new files to be created
2. Show a diff for each file that will be modified
3. Ask for confirmation (unless `-y` is provided)
4. Apply the changes

---

## components
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ async function checkLinks() {
);
}

void checkLinks();
void checkLinks();
72 changes: 72 additions & 0 deletions src/cli/common.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//! Common types shared across CLI commands

use clap::ValueEnum;

/// Project template types
#[derive(ValueEnum, Clone, Debug, Copy, PartialEq, Eq)]
#[value(rename_all = "lower")]
pub enum Template {
/// Minimal template with basic UI structure
Minimal,
/// Standard template with UI and API
Essential,
/// Template with database integration
Stateful,
}

impl Template {
/// Get the directory name for this template addon
pub fn directory_name(&self) -> &str {
match self {
Template::Minimal => "minimal-ui",
Template::Essential => "base",
Template::Stateful => "stateful",
}
}
}

/// AI assistant configuration types
#[derive(ValueEnum, Clone, Debug, Copy, PartialEq, Eq)]
#[value(rename_all = "lower")]
pub enum Assistant {
/// Cursor IDE rules and MCP config
Cursor,
/// VSCode instructions and MCP config
Vscode,
/// OpenAI Codex AGENTS.md file
Codex,
/// Claude project file and MCP config
Claude,
}

impl Assistant {
/// Get the directory name for this assistant addon
pub fn directory_name(&self) -> &str {
match self {
Assistant::Cursor => "cursor",
Assistant::Vscode => "vscode",
Assistant::Codex => "codex",
Assistant::Claude => "claude",
}
}
}

/// UI layout types
#[derive(ValueEnum, Clone, Debug, Copy, PartialEq, Eq)]
#[value(rename_all = "lower")]
pub enum Layout {
/// Basic layout without sidebar
Basic,
/// Sidebar navigation layout
Sidebar,
}

impl Layout {
/// Get the directory name for this layout addon (None for Basic)
pub fn directory_name(&self) -> Option<&str> {
match self {
Layout::Basic => None,
Layout::Sidebar => Some("sidebar"),
}
}
}
Loading