Command-line tool for creating and managing DBBasic apps.
"Tools, not frameworks. Scripts, not magic."
The Unix way is small composable tools. CGI was successful because it was just scripts in a directory. No build step, no generators, no magic.
- Unix Tools First: Use git, cp, sed - not custom generators
- Scripts Over Frameworks: CLI is thin wrapper around standard tools
- Optional: Can use dbbasic without CLI
- Extensible: Modules can add commands (like Django's manage.py)
- No Magic: Everything is visible, debuggable
pip install dbbasic-cli# Create a new blog app
dbbasic new blog myblog
# Enter the directory
cd myblog
# Install dependencies
pip install -r requirements.txt
# Run it
python app.pyCreates a new app from a template.
dbbasic new blog myblog
dbbasic new api myapi
dbbasic new shop myshopAvailable templates:
blog- WordPress-like blog (~200 lines)microblog- Twitter-like social app (~300 lines)api- REST API (~150 lines)shop- E-commerce (~400 lines)intranet- Basecamp-like project manager (~500 lines)
Lists all available templates.
dbbasic listRuns the app (optional, just python app.py works too).
dbbasic run
# With options
dbbasic run --port 8000Runs tests.
dbbasic testModules can add their own commands! For example:
# From dbbasic-queue
dbbasic queue:worker # Start queue worker
dbbasic queue:stats # Show queue statistics
# From dbbasic-logs
dbbasic logs:tail # Tail application logs
dbbasic logs:search # Search logs
# From dbbasic-accounts
dbbasic accounts:create # Create user account
dbbasic accounts:list # List all accountsEvery dbbasic app follows this structure:
myapp/
├── app.py # Main application file
├── data/ # TSV data files
│ ├── posts.tsv
│ └── users.tsv
├── templates/ # HTML templates
│ ├── layout.html
│ ├── home.html
│ └── posts/
│ ├── list.html
│ ├── show.html
│ └── edit.html
├── static/ # CSS, JS, images
│ ├── css/
│ ├── js/
│ └── img/
├── tests/ # Test files
│ └── test_app.py
├── requirements.txt # Python dependencies
└── README.md # Documentation
Modules can provide CLI commands by including a cli.py:
# dbbasic_yourmodule/cli.py
def hello_command(args):
"""Say hello"""
print("Hello from your module!")
def stats_command(args):
"""Show statistics"""
print("Module statistics here...")
# Register commands
COMMANDS = {
'yourmodule:hello': hello_command,
'yourmodule:stats': stats_command,
}Now these work automatically:
dbbasic yourmodule:hello
dbbasic yourmodule:statsYou don't need the CLI to use dbbasic. The "pure Unix way":
# Clone an example
git clone https://github.com/askrobots/dbbasic-examples
cp -r dbbasic-examples/blog myblog
cd myblog
rm -rf .git
# Run it
python app.pyThe CLI is just a convenience wrapper around standard Unix commands.
mkdir myblog
cd myblog
cat > index.cgi << 'EOF'
#!/bin/bash
echo "Content-Type: text/html"
echo ""
echo "<h1>My Blog</h1>"
EOF
chmod +x index.cgirails new blog # Generates 50+ files
rails g model Post
rails g controller Postsdbbasic new blog myblog # Optional convenience
# OR just: git clone + cp + python app.py# Clone the repo
git clone https://github.com/askrobots/dbbasic-cli
cd dbbasic-cli
# Install in development mode
pip install -e .
# Test it
dbbasic help- Core CLI: ~200 lines
- Total: ~250 lines with packaging
- Compare to:
- Rails CLI: ~10,000+ lines
- Django CLI: ~5,000+ lines
- CGI: 0 lines (no CLI needed)
MIT