android-rust-cli-0.2.6 is not a library.
Android Rust CLI
A command-line tool for scaffolding Android projects with Rust JNI integration. Generate production-ready project templates with customizable package names and support for multiple architectural patterns.
╭──────────────────────────────────────────╮
│ │
│ ╔═╗╔╗╔╔╦╗╦═╗╔═╗╦╔╦╗ ╦═╗╦ ╦╔═╗╔╦╗ │
│ ╠═╣║║║ ║║╠╦╝║ ║║ ║║ ╠╦╝║ ║╚═╗ ║ │
│ ╩ ╩╝╚╝═╩╝╩╚═╚═╝╩═╩╝ ╩╚═╚═╝╚═╝ ╩ │
│ │
╰──────────────────────────────────────────╯
Features
- Instant Project Setup — Create fully-configured Android + Rust projects in seconds
- Multiple Templates — Standard, multi-module, and bottom navigation layouts
- Smart Package Management — Automatic package name substitution across Java/Kotlin and Rust
- Environment Diagnostics —
doctorcommand checks your toolchain setup - Shell Completions — Full support for bash, zsh, fish, and PowerShell
- Dry Run Mode — Preview what will be created before writing files
- Custom Templates — Bring your own templates from any directory
- JNI Convention Handling — Automatic package name encoding for JNI bindings
Installation
Quick Start
# Create a new project (interactive mode)
# Specify template and package name
# Preview without creating files
# See available templates with descriptions
Commands
new — Create a New Project
| Option | Description |
|---|---|
--template <NAME> |
Template to use (standard, multi-module, bottom-nav) |
--package-name <PKG> |
Android package name (e.g., com.example.app) |
--template-path <PATH> |
Use custom templates from directory |
--force |
Overwrite existing files |
--dry-run |
Preview without creating files |
list-templates — View Available Templates
doctor — Check Environment
Diagnose your development environment:
Checks:
- ✓ Rust toolchain version
- ✓ Android NDK installation
- ✓ cargo-ndk availability
- ✓ Required Android targets
completions — Generate Shell Completions
# Bash
# Zsh
# Fish
# PowerShell
Templates
| Template | Description |
|---|---|
standard |
Basic Android + Rust JNI project with single module |
multi-module |
Clean architecture with app, domain, and data modules |
bottom-nav |
Bottom navigation layout with Jetpack Compose |
Custom Templates
Use your own template directories:
# List custom templates
# Generate from custom template
Creating Custom Templates
- Create a directory for your template
- Add a
template.tomlfile:
[]
= "My custom Android + Rust template"
= ["jni", "compose", "custom"]
-
Use Jinja2 template syntax in files:
{{ package_name }}— Package name (e.g., com.example.app){{ package_path }}— Package path (e.g., com/example/app){{ jni_package }}— JNI-encoded package (e.g., com_example_app)
-
Use
__package_path__in directory names to create package structure
Non-Interactive Mode
For CI/CD pipelines, all options can be specified via flags:
Defaults when stdin is not a terminal:
- Package:
dev.rodroid.rust - Template:
standard(if available)
Credits
Rodroid Mods