| Crates.io | acton-htmx-cli |
| lib.rs | acton-htmx-cli |
| version | 1.0.0-beta.7 |
| created_at | 2025-11-25 19:46:47.376776+00 |
| updated_at | 2025-11-25 19:46:47.376776+00 |
| description | CLI tool for acton-htmx framework |
| homepage | https://acton-htmx.dev |
| repository | https://github.com/GovCraft/acton-htmx |
| max_upload_size | |
| id | 1950353 |
| size | 333,060 |
Status: 🟢 Phase 1 Complete - Documentation & Examples (Week 12)
Opinionated Rust web framework for server-rendered HTMX applications
acton-htmx is a production-grade web framework that gets you from idea to deployment in minutes, not days. Built on battle-tested components from the Acton ecosystem, it combines Axum's performance with HTMX's hypermedia-driven architecture.
acton-htmx new myapp and you're running# Install CLI
cargo install acton-htmx-cli
# Create new project
acton-htmx new blog
cd blog
# Set up database
createdb blog_dev
acton-htmx db migrate
# Start development server with hot reload
acton-htmx dev
Visit http://localhost:3000 to see your app running!
use acton_htmx::prelude::*;
use askama::Template;
#[derive(Template)]
#[template(path = "posts/index.html")]
struct PostsIndexTemplate {
posts: Vec<Post>,
}
pub async fn index(
State(state): State<ActonHtmxState>,
HxRequest(is_htmx): HxRequest,
) -> impl axum::response::IntoResponse {
let posts = sqlx::query_as!(Post, "SELECT * FROM posts ORDER BY created_at DESC")
.fetch_all(&state.db_pool)
.await
.unwrap();
// Automatically returns full page or partial based on HX-Request header
PostsIndexTemplate { posts }.render_htmx(is_htmx)
}
pub async fn create(
State(state): State<ActonHtmxState>,
mut session: SessionExtractor,
Form(form): Form<PostForm>,
) -> Result<HxRedirect, FormError> {
form.validate()?;
let post_id = sqlx::query_scalar::<_, i64>(
"INSERT INTO posts (title, body) VALUES ($1, $2) RETURNING id"
)
.bind(&form.title)
.bind(&form.body)
.fetch_one(&state.db_pool)
.await?;
session.add_flash(FlashMessage::success("Post created!"));
Ok(HxRedirect(format!("/posts/{post_id}").parse().unwrap()))
}
acton-htmx reuses 60-70% of production infrastructure from the Acton ecosystem:
# Generate and view API documentation
cargo doc --no-deps --open
A generated project includes:
my-app/
├── src/
│ ├── main.rs # Application entry point with actor runtime
│ ├── handlers/ # Request handlers
│ │ ├── home.rs # Home page
│ │ └── auth.rs # Login, register, logout
│ └── models/
│ └── user.rs # User model with SQLx
├── templates/ # Askama templates
│ ├── layouts/
│ │ ├── base.html # Base HTML layout with HTMX
│ │ └── app.html # App layout with nav/footer
│ ├── auth/
│ │ ├── login.html # Login form
│ │ └── register.html # Registration form
│ ├── partials/
│ │ ├── nav.html # Navigation component
│ │ └── flash.html # Flash messages
│ └── home.html # Welcome page
├── static/ # CSS, JS, images
│ └── css/
│ └── app.css # Complete stylesheet
├── config/ # Configuration files
│ ├── development.toml # Dev settings
│ └── production.toml # Production settings
├── migrations/ # SQLx database migrations
│ └── 001_create_users.sql
└── Cargo.toml # Dependencies configured
Phase 1 Complete: ✅ Foundation & Documentation (Weeks 1-12)
Week 1-2: Foundation
Week 3-4: HTMX Layer
Week 5-6: Templates
Week 7-8: Authentication
Week 9-10: Security
Week 11: CLI
acton-htmx new - Project scaffoldingacton-htmx dev - Development serveracton-htmx db:migrate - Database migrationsacton-htmx db:reset - Database resetWeek 12: Documentation
After Phase 1, Phase 2 will add:
acton-htmx scaffold crud)| Feature | acton-htmx | Loco | Axum | Rails |
|---|---|---|---|---|
| Time to First App | < 5 min | 10 min | 60 min | 10 min |
| HTMX Integration | First-class | Supported | Manual | Manual |
| Auth for Browsers | Session-based | JWT-focused | Manual | Session-based |
| CSRF Protection | Built-in | Manual | Manual | Built-in |
| Template Type Safety | Compile-time | Runtime | N/A | Runtime |
| Security Defaults | Opinionated | Configurable | Manual | Opinionated |
| Actor System | Built-in | No | No | No |
| Performance | Excellent | Excellent | Excellent | Good |
| Learning Curve | Low | Medium | High | Low |
We welcome contributions! See Development Workflow for setup instructions.
Development Standards:
unsafe code (enforced via #![forbid(unsafe_code)])# Clone repository
git clone https://github.com/yourusername/acton-htmx
cd acton-htmx
# Build workspace
cargo build
# Run tests
cargo test
# Run clippy
cargo clippy -- -D warnings
# Generate documentation
cargo doc --no-deps --open
acton-htmx is built on Axum and inherits its excellent performance:
Security is a first-class concern:
MIT
Built on:
Ready to build? Start with the Getting Started Guide!
Govcraft is a one-person shop—no corporate backing, no investors, just me building useful tools. If this project helps you, sponsoring keeps the work going.