Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/kilo-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Kilo Dispatch

on:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Add explicit workflow permissions

Defining permissions at the workflow level (for example contents: read) limits the default GITHUB_TOKEN scope and reduces risk for a dispatchable workflow.

workflow_dispatch:
inputs:
prompt:
description: Prompt passed to Kilo CLI
required: true
type: string
timeout_minutes:
description: Timeout in minutes for job and Kilo run
required: false
default: "30"
type: string

jobs:
run-kilo:
name: run-kilo
runs-on: ubuntu-latest
timeout-minutes: ${{ fromJSON(inputs.timeout_minutes) }}

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Kilo CLI
run: npm install -g @kilocode/cli
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Cache npm artifacts for faster installs

Installing the CLI globally on every run re-downloads packages. Adding an actions cache for ~/.npm can cut cold-start time and reduce network variance.


- name: Verify KILO_API_TOKEN secret
run: |
if [ -z "${{ secrets.KILO_API_TOKEN }}" ]; then
echo "KILO_API_TOKEN secret is missing. Add it in repository settings before running this workflow."
exit 1
fi

- name: Run Kilo CLI
env:
KILO_API_TOKEN: ${{ secrets.KILO_API_TOKEN }}
KILO_API_KEY: ${{ secrets.KILO_API_TOKEN }}
run: |
set -euo pipefail
: > kilo-run.log
kilo --version 2>&1 | tee -a kilo-run.log
if kilo run --help 2>&1 | grep -q -- '--timeout'; then
kilo run --auto "${{ inputs.prompt }}" --timeout "${{ inputs.timeout_minutes }}m" 2>&1 | tee -a kilo-run.log
else
echo "kilo run does not support --timeout; relying on job timeout-minutes." | tee -a kilo-run.log
kilo run --auto "${{ inputs.prompt }}" 2>&1 | tee -a kilo-run.log
fi

- name: Upload Kilo run log
if: always()
uses: actions/upload-artifact@v4
with:
name: kilo-run-log
path: kilo-run.log
Loading