Your First Project
This tutorial walks through setting up a project with multiple daemons managed by pitchfork.
Create a Configuration File
In your project root, create pitchfork.toml:
toml
[daemons.api]
run = "npm run server:api"
[daemons.docs]
run = "npm run server:docs"
[daemons.redis]
run = "redis-server"This defines three daemons: an API server, a docs server, and Redis.
Start Your Daemons
Start all daemons at once:
bash
pitchfork start --allOr start specific ones:
bash
pitchfork start api redisCheck Status
View all running daemons:
bash
pitchfork listOutput:
NAME PID STATUS
api 12345 running
docs 12346 running
redis 12347 runningGet detailed status for one daemon:
bash
pitchfork status apiView Logs
See logs for a specific daemon:
bash
pitchfork logs apiFollow logs in real-time:
bash
pitchfork logs api --tailView logs for multiple daemons:
bash
pitchfork logs api docsStop Daemons
Stop a specific daemon:
bash
pitchfork stop apiStop all daemons:
bash
pitchfork stop api docs redisRestart on Changes
If a daemon is already running, pitchfork start does nothing. Use --force to restart:
bash
pitchfork start api --forceAdd Ready Checks
Make pitchfork wait until your daemon is actually ready:
toml
[daemons.api]
run = "npm run server:api"
ready_http = "http://localhost:3000/health"
[daemons.redis]
run = "redis-server"
ready_output = "Ready to accept connections"See Ready Checks for all options.
Enable Auto-Restart
Have pitchfork automatically restart daemons that crash:
toml
[daemons.api]
run = "npm run server:api"
retry = 3 # Restart up to 3 times on failureSee Auto Restart for details.
What's Next?
- Shell Hook - Auto-start when entering project directories
- Ready Checks - Configure readiness detection
- Configuration Reference - All configuration options
