@tray-sh/cli 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +54 -2
- package/bin/tray.cjs +25 -0
- package/package.json +23 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Siddharth Borderwala
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tray
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Tray turns a folder or an HTML file into a link you can share. Put it on a tray, pass it around. For you, your agents and your friends.
|
|
4
|
+
|
|
5
|
+
<picture>
|
|
6
|
+
<source media="(prefers-color-scheme: dark)" srcset=".github/assets/banner-dark.png">
|
|
7
|
+
<img alt="tray. Artifacts for every agent. Put it on a tray. Pass it around." src=".github/assets/banner-light.png">
|
|
8
|
+
</picture>
|
|
9
|
+
|
|
10
|
+
Tray runs on your own Cloudflare account, on Workers, R2 and Access, so your sites and data stay yours. Setup takes about 60 seconds.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
curl -fsSL https://tray.sh/install | sh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or with npm: `npm i -g @tray-sh/cli`. Either way, the command is `tray`.
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
tray setup --domain acme.dev # once: creates the Worker, bucket, DNS and TLS
|
|
24
|
+
tray put ./q3-review # → https://q3-review.acme.dev
|
|
25
|
+
tray put ./q3-review --private # only you can see it
|
|
26
|
+
tray share q3-review bob@acme.com # …and Bob
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Agents use the same CLI: `tray put ./out --json` prints the result as JSON and never prompts. Docs for agents live at [tray.sh/llms.txt](https://tray.sh/llms.txt).
|
|
30
|
+
|
|
31
|
+
Full docs: [tray.sh](https://tray.sh).
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
bun install
|
|
37
|
+
bun test # all tests
|
|
38
|
+
bun run build # worker → cli → site
|
|
39
|
+
bun run lint && bun run fmt:check
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The repo is a Bun workspace:
|
|
43
|
+
|
|
44
|
+
| Path | What |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `apps/cli` | The `tray` CLI (Bun, compiled to a single binary) |
|
|
47
|
+
| `apps/worker` | The Cloudflare Worker: API and site serving (Hono) |
|
|
48
|
+
| `apps/site` | tray.sh (Astro) |
|
|
49
|
+
| `packages/schema` | Shared zod schemas for the API |
|
|
50
|
+
|
|
51
|
+
See [SPEC.md](SPEC.md) for how it all works. Issues and PRs welcome.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
[MIT](LICENSE)
|
package/bin/tray.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for `npm i -g @tray-sh/cli`: runs the prebuilt binary from the
|
|
3
|
+
// matching platform package (@tray-sh/cli-<os>-<arch>).
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
|
|
6
|
+
const os = { darwin: "darwin", linux: "linux", win32: "windows" }[process.platform];
|
|
7
|
+
const arch = { x64: "x64", arm64: "arm64" }[process.arch];
|
|
8
|
+
const musl =
|
|
9
|
+
process.platform === "linux" && !process.report?.getReport().header.glibcVersionRuntime;
|
|
10
|
+
const target = `${os}-${arch}${musl ? "-musl" : ""}`;
|
|
11
|
+
const exe = process.platform === "win32" ? "tray.exe" : "tray";
|
|
12
|
+
|
|
13
|
+
let bin;
|
|
14
|
+
try {
|
|
15
|
+
bin = require.resolve(`@tray-sh/cli-${target}/bin/${exe}`);
|
|
16
|
+
} catch {
|
|
17
|
+
console.error(
|
|
18
|
+
`tray: no prebuilt binary for ${target}. Try: curl -fsSL https://tray.sh/install | sh`,
|
|
19
|
+
);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
24
|
+
if (result.signal) process.kill(process.pid, result.signal);
|
|
25
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tray-sh/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Artifacts for every agent. Turn a folder or an HTML file into a link you can share.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://tray.sh",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/siddharthborderwala/tray.git"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"tray": "bin/tray.cjs"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin"
|
|
16
|
+
],
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@tray-sh/cli-darwin-arm64": "0.1.0",
|
|
19
|
+
"@tray-sh/cli-darwin-x64": "0.1.0",
|
|
20
|
+
"@tray-sh/cli-linux-arm64": "0.1.0",
|
|
21
|
+
"@tray-sh/cli-linux-x64": "0.1.0",
|
|
22
|
+
"@tray-sh/cli-linux-arm64-musl": "0.1.0",
|
|
23
|
+
"@tray-sh/cli-linux-x64-musl": "0.1.0",
|
|
24
|
+
"@tray-sh/cli-windows-x64": "0.1.0"
|
|
25
|
+
}
|
|
6
26
|
}
|