Skip to content

Commit 190fba0

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

1 file changed

Lines changed: 38 additions & 9 deletions

File tree

taskfile.yaml

Lines changed: 38 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,13 @@ 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+
- echo 'Your agent has been created!'
14+
- task: help_run_console
15+
- task: help_open_web_console
2016
- echo ''
2117
- echo 'To deploy your agent to LiveKit cloud:'
2218
- echo ''
23-
- echo '{{ indent .INDENT "lk agent create" }}'
19+
- echo '{{ indent .INDENT "lk agent deploy" }}'
2420
- echo ''
2521
- task: set_agent_name_if_present
2622
- task: help_open_sandbox_if_present
@@ -39,19 +35,52 @@ tasks:
3935
done < "$file"
4036
mv "$tmp" "$file"
4137
38+
help_run_console:
39+
status:
40+
- test -n "$LIVEKIT_AGENT_NAME"
41+
cmds:
42+
- echo 'To try your new agent directly in your terminal:'
43+
- echo ''
44+
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
45+
- echo '{{ indent .INDENT "uv sync" }}'
46+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} download-files'
47+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} console'
48+
49+
help_open_web_console:
50+
status:
51+
- test -z "$LIVEKIT_AGENT_NAME"
52+
vars:
53+
CONSOLE_URL: "https://cloud.livekit.io/projects/p_/agents/console"
54+
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\\" }}'
55+
cmds:
56+
- echo 'To try your new agent in the web console:'
57+
- echo ''
58+
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
59+
- echo '{{ indent .INDENT "uv sync" }}'
60+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} download-files'
61+
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} dev'
62+
- echo ''
63+
- echo 'Then visit:'
64+
- echo ''
65+
- echo '{{ indent .INDENT .CONSOLE_LINK }}'
66+
4267
help_open_sandbox_if_present:
4368
status:
4469
- test -z "$LIVEKIT_SANDBOX_ID"
70+
vars:
71+
SANDBOX_URL: 'https://{{ .LIVEKIT_SANDBOX_ID }}.sandbox.livekit.io'
72+
SANDBOX_LINK: '{{ print "\x1b]8;;" .SANDBOX_URL "\x1b\\\x1b[36;4m" .SANDBOX_URL "\x1b[0m\x1b]8;;\x1b\\" }}'
4573
cmds:
4674
- echo 'To chat with your running agent, visit:'
4775
- echo ''
48-
- echo '{{ indent .INDENT "https://" }}{{ .LIVEKIT_SANDBOX_ID }}.sandbox.livekit.io'
76+
- echo '{{ indent .INDENT .SANDBOX_LINK }}'
4977
- echo ''
5078

5179
install:
5280
desc: "Bootstrap application for local development"
5381
cmds:
5482
- "uv sync"
83+
5584
dev:
5685
interactive: true
5786
cmds:

0 commit comments

Comments
 (0)