Skip to content

Commit 0d87dfe

Browse files
committed
chore: add local testing helper script
Add test_local.sh for convenient local testing during development.
1 parent dae92d3 commit 0d87dfe

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test_local.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
# Helper script for testing CLI commands against local any-llm platform
3+
#
4+
# This script simplifies testing by automatically setting up credentials
5+
# for the local development environment.
6+
#
7+
# Default credentials (can be overridden via environment variables):
8+
# ANY_LLM_USERNAME=admin@example.com
9+
# ANY_LLM_PASSWORD=changethis
10+
# ANY_LLM_PLATFORM_URL=http://localhost:8100/api/v1
11+
#
12+
# Usage:
13+
# ./test_local.sh project list
14+
# ./test_local.sh key list <project-id>
15+
# ./test_local.sh --format json project list
16+
# ./test_local.sh project create "My Project" --description "Test project"
17+
# ./test_local.sh budget create <project-id> 100.0 --period monthly
18+
# ./test_local.sh client create <project-id> "My Client" --default
19+
#
20+
# Override credentials:
21+
# ANY_LLM_USERNAME=myuser@example.com ./test_local.sh project list
22+
# ANY_LLM_PASSWORD=mypassword ./test_local.sh project list
23+
# ANY_LLM_PLATFORM_URL=http://localhost:9000/api/v1 ./test_local.sh project list
24+
25+
set -e
26+
27+
# Default credentials for local testing
28+
export ANY_LLM_USERNAME="${ANY_LLM_USERNAME:-admin@example.com}"
29+
export ANY_LLM_PASSWORD="${ANY_LLM_PASSWORD:-changethis}"
30+
export ANY_LLM_PLATFORM_URL="${ANY_LLM_PLATFORM_URL:-http://localhost:8100/api/v1}"
31+
32+
# Run the CLI with the provided arguments
33+
uv run any-llm "$@"

0 commit comments

Comments
 (0)