Skip to content

Commit 751044e

Browse files
committed
chore(task): if agent is named, print console link after bootstrap
1 parent 758c9b9 commit 751044e

1 file changed

Lines changed: 37 additions & 9 deletions

File tree

taskfile.yaml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
version: "3"
2-
output: interleaved
32
dotenv: [".env.local"]
43
vars:
54
INDENT: 4
@@ -11,16 +10,12 @@ tasks:
1110
post_create:
1211
desc: "Runs after this template is instantiated as a Sandbox or Bootstrap"
1312
cmds:
14-
- echo 'To try the new agent directly in your terminal:'
15-
- echo ''
16-
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
17-
- echo '{{ indent .INDENT "uv sync" }}'
18-
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} download-files'
19-
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} console'
13+
- task: help_run_console
14+
- task: help_open_web_console
2015
- echo ''
2116
- echo 'To deploy your agent to LiveKit cloud:'
2217
- echo ''
23-
- echo '{{ indent .INDENT "lk agent create" }}'
18+
- echo '{{ indent .INDENT "lk agent deploy" }}'
2419
- echo ''
2520
- task: set_agent_name_if_present
2621
- task: help_open_sandbox_if_present
@@ -39,19 +34,52 @@ tasks:
3934
done < "$file"
4035
mv "$tmp" "$file"
4136
37+
help_run_console:
38+
status:
39+
- test -n "$LIVEKIT_AGENT_NAME"
40+
cmds:
41+
- echo 'To try your new agent directly in your terminal:'
42+
- echo ''
43+
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
44+
- echo '{{ indent .INDENT "uv sync" }}'
45+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} download-files'
46+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} console'
47+
48+
help_open_web_console:
49+
status:
50+
- test -z "$LIVEKIT_AGENT_NAME"
51+
vars:
52+
CONSOLE_URL: "https://cloud.livekit.io/projects/p_/agents/console"
53+
CONSOLE_LINK: '{{ print "\x1b]8;;" .CONSOLE_URL "/?autoStart=true&agentName=" .LIVEKIT_AGENT_NAME "\x1b\\\x1b[36;4m" .CONSOLE_URL "/?autoStart=true&agentName=" .LIVEKIT_AGENT_NAME "\x1b[0m\x1b]8;;\x1b\\" }}'
54+
cmds:
55+
- echo 'To try your new agent in the web console:'
56+
- echo ''
57+
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
58+
- echo '{{ indent .INDENT "uv sync" }}'
59+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} download-files'
60+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} dev'
61+
- echo ''
62+
- echo 'Then visit:'
63+
- echo ''
64+
- echo '{{ indent .INDENT .CONSOLE_LINK }}'
65+
4266
help_open_sandbox_if_present:
4367
status:
4468
- test -z "$LIVEKIT_SANDBOX_ID"
69+
vars:
70+
SANDBOX_URL: 'https://{{ .LIVEKIT_SANDBOX_ID }}.sandbox.livekit.io'
71+
SANDBOX_LINK: '{{ print "\x1b]8;;" .SANDBOX_URL "\x1b\\\x1b[36;4m" .SANDBOX_URL "\x1b[0m\x1b]8;;\x1b\\" }}'
4572
cmds:
4673
- echo 'To chat with your running agent, visit:'
4774
- echo ''
48-
- echo '{{ indent .INDENT "https://" }}{{ .LIVEKIT_SANDBOX_ID }}.sandbox.livekit.io'
75+
- echo '{{ indent .INDENT .SANDBOX_LINK }}'
4976
- echo ''
5077

5178
install:
5279
desc: "Bootstrap application for local development"
5380
cmds:
5481
- "uv sync"
82+
5583
dev:
5684
interactive: true
5785
cmds:

0 commit comments

Comments
 (0)