cool_browse
Browse public web page
Load a public URL in a headless browser and return it in format content (the rendered HTML), markdown, or links (the page's links). When the browser reports the page's response with a status and headers, status is that HTTP status (such as 404), and a response whose headers name a type that is not HTML, or none (an empty 404), is fetched again and comes back as served, with that answer's own status and content_type: in text when it is valid UTF-8, otherwise base64-encoded in content_base64 with encoding "base64" and its size in bytes. If that answer names no type and sniffs as HTML, the rendering stays. Without the report, the rendering comes back with no status.
輸入參數url必填format必填computer必填
cool_clear_service
Clear service
Stop the durable service and delete its saved configuration without changing HTTP exposure.
輸入參數computer必填
cool_connect_integration
Connect integration
Start a browser connection, or provide the CLI command for a service that needs terminal input.
輸入參數provider必填
cool_create_computer
Create computer
Create a computer with its own VM: an always-on Ubuntu machine with sudo, at https://<name>.cool.computer and <name>@mail.cool.computer, with nothing served yet. It uses 1 of the account's 20 VMs and memory from its 8 GiB. Start a program on it with cool_run_service. For a page or a site, use cool_publish, with visibility private for a private one.
輸入參數namevisibilityauto_delete_after
cool_delete_computer
Delete computer
Permanently delete an account-owned computer and its stored disk.
輸入參數computer必填
cool_delete_file
Delete a file
Delete a file, or a folder and everything in it with recursive. On a computer with a VM it deletes from its disk; on a site without a VM it publishes a new live release without the file, as a publish does. Deleting never gives a computer a VM.
輸入參數path必填computer必填recursive
cool_delete_secrets
Delete a secret set
Delete a whole secret set and its keys, as cool secrets delete does. Deleting a set that does not exist changes nothing. State pending means the computers' egress proxies still hold its proxy keys; that finishes automatically.
輸入參數secret_set必填
cool_disconnect_integration
Disconnect integration
Disconnect a service; pending means it finishes automatically.
輸入參數name必填
Run one shell command on a computer with a VM, as cool exec does, and wait for it to finish: it returns its status, exit code and the last 16 KiB of its stdout and of its stderr (omitted_bytes counts what was left out; write long output to a file and read it with cool_read_file). A command still running after timeout seconds (60 when left out, at most 300), or when the call's connection closes, is stopped; keep a server or long task running with cool_run_service instead. A site without a VM takes no commands: give it one with cool_give_vm first, only when the work needs a VM.
輸入參數cwdcommand必填timeoutcomputer必填
cool_expose_port
Expose an HTTP port
Point the computer's HTTPS URL at one HTTP port without starting or stopping processes or changing sharing. Replaces the previous selected port. On a site served from its VM, the port answers every path but the site's functions (/api), and its files in /home/runtime/app are never served as files again, even after the port is removed. A site with no VM answers needs_vm: start its program with cool_run_service, which gives it a VM and exposes the port.
輸入參數port必填computer必填
cool_get_computer
Inspect a computer
Return one of the account's computers, by its name or id.
輸入參數computer必填
cool_get_computer_network
Inspect computer network
Return one computer's outbound network policy.
輸入參數computer必填
cool_get_default_network
Inspect default network policy
Return the account's default outbound network policy.
無需輸入參數。
cool_get_domain
Inspect custom domain
Return the computer's custom domain: its hostname, state, what it waits for (detail), and the two DNS records the owner creates at their DNS provider. challenge waits for the TXT record, issuing for the CNAME, serving for the hostname to answer through Cool Computers; active serves what the computer's own address serves.
輸入參數computer必填
cool_get_email_address
Show mailbox address
Return one computer's Cool Computers email address.
輸入參數computer必填
cool_get_exposure
Inspect HTTP exposure
Return the selected HTTP port and website access setting. This is configuration, not application health.
輸入參數computer必填
cool_get_integration_connect
Inspect integration connection
Return an account-scoped connection attempt.
輸入參數id必填
cool_get_logs
Read function failures
Return the latest failures of an account-owned site's edge functions, newest first: when each happened, the request's method and path (never its query), the release, and the error the module raised (name, message and first stack frame). Use it when a request under /api/ answers "function failed". Only an invocation that threw or passed its CPU or subrequest limit is kept; a function that answers an error status itself, and console output, are not. A site with a VM runs its functions there and answers function_logs_on_vm.
輸入參數computer必填
cool_get_secret_metadata
Inspect secret metadata
Return one secret set's metadata without plaintext values.
輸入參數secret_set必填
cool_get_service
Inspect service
Return the computer's service and its current state: status (starting, running, restarting, stopped, exited or failed), ready, restarts since it was last started, last_exit, and last_output, the program's last line while it is not ready.
輸入參數computer必填
cool_get_service_logs
Read service logs
Return a bounded non-following tail of typed service stdout and stderr.
輸入參數tailsincecomputer必填
cool_get_usage
Show account usage
Return the account's limits and defaults next to what it uses now: computers with a VM against the quota, memory, storage, and sites created in the last 24 hours.
無需輸入參數。
cool_give_vm
Give a site its VM
Give an existing site its own VM, in place, as cool vm does: an always-on Ubuntu machine with sudo, where cool_exec, cool_run_service and cool_write_files work. The site keeps its name and URL; its published files move to /home/runtime/app and keep serving until a program's port is exposed. It cannot be undone: it uses 1 of the account's 20 VMs and memory from its 8 GiB, and publishing to it stops, so change its files with cool_write_files or cool_exec, and publish to a new name for a separate site. Do it only when the work needs a VM: a server or bot that stays up, a schedule or a long task; never just to change files. Running it on a computer that already has a VM changes nothing (changed false). cool_run_service gives a site its VM too, and cool_create_computer makes a new computer with one.
輸入參數computer必填
cool_list_computers
List computers
List this account's computers and their current states.
無需輸入參數。
cool_list_emails
List mailbox messages
List bounded summaries of the newest messages, newest first. Read the metadata part when a summary is truncated.
輸入參數limitcomputer必填
cool_list_files
List files
List one folder of a computer's files: on a site without a VM, its live published files, all under /home/runtime/app; on a computer with a VM, its disk. Entries come in name order, a page at a time: when eof is false, list again with offset next_offset. Reading never gives a computer a VM.
輸入參數pathlimitoffsetcomputer必填
cool_list_integrations
List integrations
Return connected services and health without credentials.
無需輸入參數。
cool_list_network_denials
List network denials
Return recent denied outbound requests for one computer.
輸入參數computer必填
cool_list_releases
List releases
List a site's releases, newest first, as cool releases does: each one's number, state, whether it is live, its file count, bytes and when it was made.
輸入參數computer必填
cool_list_secret_audit
List secret audit history
Return a bounded secret metadata audit history without plaintext values.
輸入參數tailsince
cool_list_secrets
List secret metadata
Return secret-set names, key names, and delivery metadata without plaintext values.
無需輸入參數。
cool_list_shares
List shares
Show who can open a computer, as cool share list does: its visibility (public: anyone with its URL; private: the owner and the people listed) and everyone it is shared with, the owner first, each with access and state (pending until an invited person accepts). Change it with cool_share and cool_set_computer_visibility.
輸入參數computer必填
cool_mkdir
Create a folder
Create a folder on a computer with a VM; with parents, its missing parent folders too, and then a folder that already exists is no error. A site without a VM has no folders of its own: publish files under the folder with cool_publish instead.
輸入參數path必填parentscomputer必填
cool_plan_switch_workspace
Plan workspace switch
Return the exact read-only plan for a GitHub branch workspace.
輸入參數fromrepo必填branch必填create
cool_promote_release
Promote release
Make an earlier release of a site live again, as cool releases promote does: the way to roll back. Its number comes from cool_list_releases; the release that was live stays listed and can be promoted back.
輸入參數number必填computer必填
To show something, publish the files with cool_publish (instant, no VM). To keep a server running, use cool_run_service, which gives the computer its own VM. Publishes a website or browser app from files, served at the computer's URL. Without computer, creates a new computer for them, named by name, public unless visibility is private: a private site is private from the start; with computer, an existing site's name or id, makes them its new live release, and the site keeps its visibility. A computer with a VM takes no release: write its files on the VM instead. Add cool.json {"spa": true} to serve index.html for unknown paths. For small API handlers without a VM, add cool.json {"functions": "api/worker.js"}: that bundled ES module's default export { fetch(request, env) } answers /api and every /api/ path at the edge; add "secrets": "<set>" to give it the keys of that account secret set (cool secrets set) as env. cool.json {"run": "start command", "port": 3000} is a shortcut for starting a server by hand: the computer gets its own VM, the files land in /home/runtime/app and are served from there, and the command starts there and answers every path, /api included; the folder is no longer served as files. The result then reports vm true. Keep keys in a secret set. Build framework apps first and publish the build output. Paths are relative. All arguments together are limited to 64 KiB, so this suits small text sites; publish anything larger with POST /api/publish or cool publish.
輸入參數namefiles必填computervisibility
cool_query_database
Query site database
Run SQL against an account-owned site's database. Use sql with optional positional params for one statement, or statements for a transaction. This can change data. A site needs cool.json with database: true and functions, then a published release. Keep SELECT results small with LIMIT.
輸入參數sqlparamscomputer必填statements
cool_read_email
Read mailbox message
Read one bounded UTF-8 metadata, text, or HTML chunk. Start at offset zero, then continue with the returned version and next_offset until eof; restart at zero if the content changes.
輸入參數part必填limitoffsetversioncomputer必填email_id必填
cool_read_file
Read a file
Read one file of a computer, as cool_list_files sees them, of at most 2 MiB, in chunks of at most 32768 bytes. The result has content when the chunk is UTF-8 text, else content_base64, with the file's size, its version (the SHA-256 of the whole file), next_offset and eof. To read on, pass offset next_offset and the version of the first chunk; a file that changed meanwhile is read again from offset 0.
輸入參數path必填limitoffsetversioncomputer必填
cool_remove_domain
Remove custom domain
Remove the computer's custom domain. The hostname stops serving within seconds; the computer's own address is unchanged. A computer without a domain answers removed too.
輸入參數computer必填
cool_reply_email
Reply to email
Reply to a stored email; Cool Computers resolves the recipient, subject, and thread.
輸入參數htmltextcomputer必填email_id必填
cool_restart_service
Restart service
Restart the configured durable service on an account-owned computer without changing HTTP exposure.
輸入參數computer必填
cool_run_service
Run service
Save and start the computer's one long-running program and keep it running: after a crash it starts again after 1 s, doubling up to 60 s, and the service counts the restarts. Running it again replaces the service. With port, it is ready once the port accepts connections, and the computer's URL reaches it; without port (a bot or a worker) it is ready once it has stayed up for 5 s, and the URL is unchanged. The result says status running only once it is ready; a program still installing or starting returns status starting with a notice, and keeps starting in the background: check it with cool_get_service, do not run it again. To show something, publish the files with cool_publish (instant, no VM). On a site with no VM it first gives the site its own VM, which cannot be undone: it uses 1 of the account's 20 VMs and memory from its 8 GiB, publishing to it stops, and its files move to /home/runtime/app; once its port is exposed, the service answers every path but a site's functions (/api), and /home/runtime/app is never served as files again, even after the port is removed: the service serves its own static files.
輸入參數cwdenvportcommand必填secretscomputer必填
cool_send_email
Send email
Send one outbound email from an account-owned computer mailbox.
輸入參數to必填htmltextsubject必填computer必填
cool_set_computer_network
Change computer network policy
Set the outbound network policy for one account-owned computer.
輸入參數mode必填computer必填allowed_hosts
cool_set_computer_visibility
Change computer visibility
Make an account-owned computer public or private.
輸入參數computer必填visibility必填
cool_set_default_network
Change default network policy
Set the outbound network policy inherited by newly created computers.
輸入參數mode必填allowed_hosts
cool_set_domain
Connect custom domain
Connect a subdomain the user controls, such as app.example.com (no apex, no wildcard; punycode for an internationalized name), to the computer. Give the user the two returned records to create at their DNS provider: the TXT record proves control of the hostname and must resolve within 72 hours, the CNAME sends its traffic to Cool Computers. The same hostname again returns it as it is; another hostname replaces one still waiting for its TXT record. A computer has one domain.
輸入參數computer必填hostname必填
cool_set_secrets
Set a secret set
Store a secret set, as cool secrets set does: the keys a site's functions get as env when its cool.json names the set ("secrets": "<set>"), or a VM's programs get with cool secrets exec. It replaces the whole set: send every key it should keep, with its value. Values are stored encrypted and never returned; the result counts the set's keys, and cool_get_secret_metadata lists their names. A Cool Computers API key or access token is refused: store only the keys of the services the code calls. Keys in proxy are sent only to their host: a program gets a stand-in, sends it as the Bearer token in the Authorization header, and the computer's egress proxy puts the real value in its place on https requests to that host. A site's functions get a proxy key only once the site has its VM; before that they get only the plain keys.
輸入參數proxyvalues必填secret_set必填
cool_share
Share a computer
Give a person use of a computer by their email address, or take it away: access can_use shares it, none stops sharing it with them. Sharing emails an invitation to someone this account has not shared with yet; state is pending until they accept, active once they can open it. Use it to let someone open a private site. Whoever it is shared with has full use of the computer, its files and the secret set its cool.json names included, and while it is shared it gets no other secret set or integration. The same call again changes nothing and sends no second email. The result lists everyone who can open the computer.
輸入參數email必填access必填computer必填
cool_stat_file
Inspect a file
Return one file or folder's type, size, mode and modification time, as cool_list_files sees them, without reading it.
輸入參數path必填computer必填
cool_stop_service
Stop service
Stop the configured durable service without deleting its configuration or changing HTTP exposure.
輸入參數computer必填
cool_switch_workspace
Switch workspace
Create or reuse a computer and switch it to an authorized GitHub branch workspace.
輸入參數fromrepo必填branch必填create
cool_unexpose_port
Remove HTTP exposure
Remove the selected HTTP route without stopping programs or changing sharing. The URL then shows a page saying the computer serves nothing; a site whose port was exposed never serves its files again.
輸入參數computer必填
cool_verify_integration
Verify integration
Check a connected service: test its connection with the service, record its health, and refresh its stored credential when the service asks for that. Reports any action needed to reconnect it. Running it again is safe.
輸入參數name必填
cool_whoami
Show account identity
Return the verified account owner for this conversation.
無需輸入參數。
cool_write_files
Write files
Write files on a computer with a VM, under /home/runtime, creating their folders; a file that exists is replaced. Files in /home/runtime/app are public at the computer's URL; restart its service with cool_restart_service when it should load them. A site without a VM takes no writes: publish its files with cool_publish, which replaces the whole release, so send every file, unchanged ones included (read them with cool_read_file); omitted files stop being served. Writing never gives a computer a VM.
輸入參數files必填computer必填