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
29 changes: 26 additions & 3 deletions tool.gpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
context: github.com/gptscript-ai/context/os
tools: service, port, open-file-nix, open-nix, open-file-windows, open-windows
tools: service, port, open-file-nix, open-nix, open-file-windows, open-windows, open-file-mac, open-mac
params: file: (optional) A reference to a tool file. Can refer to either a local or remote file.

Never run steps in parallel.
Expand All @@ -8,11 +8,14 @@ Perform the following steps in the order they appear:
1. Run the service
2. Get the port for the running service
3. If no {file} was provided AND the local operating system is windows, use the open-windows tool then skip the remaining steps
3. If no {file} was provided AND the local operating system is Darwin, use the open-mac tool then skip the remaining steps
4. If no {file} was provided use the open-nix tool then skip the remaining steps
5. If the operating system is windows, use the open-file-windows tool then skip the remaining steps
5. If the operating system is Darwin, use the open-file-mac tool then skip the remaining steps
6. Use the open-file-nix tool

---

name: service

#!sys.daemon /usr/bin/env npm run --prefix ${GPTSCRIPT_TOOL_DIR} dev
Expand All @@ -33,7 +36,7 @@ arg: file: The file to open

#!/usr/bin/env sh

open http://localhost:${PORT}/run?file=${FILE}
xdg-open http://localhost:${PORT}/run?file=${FILE}

---

Expand All @@ -42,7 +45,7 @@ arg: port: The port the service is listening on

#!/usr/bin/env sh

open http://localhost:${PORT}
xdg-open http://localhost:${PORT}

---

Expand All @@ -62,3 +65,23 @@ arg: port: The port the service is listening on
#!/usr/bin/env powershell.exe

start http://localhost:$env:PORT

---

name: open-file-mac
arg: port: The port the service is listening on
arg: file: The file to open

#!/usr/bin/env sh

open http://localhost:${PORT}/run?file=${FILE}

---

name: open-mac
arg: port: The port the service is listening on

#!/usr/bin/env sh

open http://localhost:${PORT}