Custom Commands
Custom commands are named scripts stored in a profile. They are available in the shell once the environment is active.
flk command add dev "npm run dev"
flk command add test "cargo test --all"
flk command list
flk command remove dev
Read the script from a file with --file:
flk command add deploy --file scripts/deploy.sh
Target another profile with --profile, placed before the subcommand:
flk command --profile backend add build "cargo build --release"
flk command --profile frontend list
Storage
Commands go in the commands list of .flk/profiles/<profile>.nix:
commands = [
{ name = "dev"; script = ''npm run dev''; }
{ name = "test"; script = ''cargo test --all''; }
];
Names
Letters, numbers, - and _, not starting with -. For example dev, run-tests, build_release.
More examples
flk command add watch "cargo watch -x 'run -- --port 8080'"
flk command add migrate "npx prisma migrate dev"
flk command add ci --file scripts/ci.sh
See also flk command.