- Change command event output:
Instead of streaming each output
Valueas a.recvevent, collect the full pipeline, then append a single frame with topic<name>.response. - Apply
return_options: The new.responseevent must respect thesuffixandttlfrom the command'sreturn_options. - Remove
.completeevent: No.completeframe is emitted for these commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create VPC | |
| VPC_ID=$(aws ec2 create-vpc \ | |
| --cidr-block 10.0.0.0/28 \ | |
| --tag-specifications 'ResourceType=vpc,Tags=[{Key=Project,Value=vibenv}]' \ | |
| --query 'Vpc.VpcId' \ | |
| --output text) | |
| # Disable DNS Support and Hostnames | |
| aws ec2 modify-vpc-attribute --vpc-id $VPC_ID --enable-dns-support "{\"Value\": false}" | |
| aws ec2 modify-vpc-attribute --vpc-id $VPC_ID --enable-dns-hostnames "{\"Value\": false}" |
meta: note that Nushell requires ( .. ) around multi-line commands, and it doesn't support trailing slashes for line continuation
# Get clean task definition template (remove AWS-managed fields)
(aws ecs describe-task-definition --task-definition your-task-definition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # $env.OPENAI_API_KEY = (.head OPENAI_API_KEY | .cas $in.hash | str trim) | |
| # $env.GPT2099_PROVIDER = { name: openai model: "gpt-4o-2024-11-20" } | |
| $env.CEREBRAS_API_KEY = (.head CEREBRAS_API_KEY | .cas $in.hash | str trim) | |
| $env.GPT2099_PROVIDER = { name: "cerebras" model: "llama-3.3-70b" } | |
| $env.GPT2099_INTERACTIVE = false | |
| $env.BOT_TOKEN = .head discord.ws.token | .cas $in.hash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Thread 26 (Thread 0x7f0be3bfd6c0 (LWP 196896) "tokio-runtime-w"): | |
| #0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 | |
| #1 0x000055d5f908e2d4 in std::sys::sync::rwlock::futex::RwLock::read_contended () | |
| #2 0x000055d5f91ea56e in lsm_tree::tree::Tree::create_internal_range () | |
| #3 0x000055d5f91e9aa1 in <lsm_tree::tree::Tree as lsm_tree::abstract::AbstractTree>::range () | |
| #4 0x000055d5f9194137 in std::sys::backtrace::__rust_begin_short_backtrace () | |
| #5 0x000055d5f91d0c3b in core::ops::function::FnOnce::call_once{{vtable.shim}} () | |
| #6 0x000055d5fa8dbbfb in std::sys::pal::unix::thread::Thread::new::thread_start () | |
| #7 0x00007f0c32a7ba94 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/s/03B..PLM/xs $ manicode | |
| Manicode will read and write files in "/Users/andy/s/03BKRZUEAK5U4GIA2V7GTWPLM/xs". Type "help" for a list of commands. | |
| Welcome back Andy Gayton! What would you like to do? | |
| xs > examine src/ main.rs, connect.rs and client.rs: I want to factor connect and client into src/client/... ie, as a module factor request and parse_request_parts into request.rs in that module (along with the tests) update src/lib.rs and src/main.rs for the new location | |
| Manicode: Reading the following files...<files>src/main.rs, src/client.rs, src/connect.rs, src/lib.rs, src/nu/commands/mod.rs, src/nu/commands/head_command.rs, src/nu/commands/cat_command.rs, src/nu/commands/remove_command.rs, src/nu/commands/append_command.rs, src/nu/mod.rs, src/http.rs, tests/integration.rs, docs/notes.md, src/error.rs</files> | |
| I'll help factor out the client code into a module structure. Here's the plan: |
@rootnegativeone referred me to https://manicode.ai/
This is the output from an initial session with it. I used it to create these two commits, including the conventional commit message. The attached session just covers adding xs head. Adding xs get was even more straight forward.
- feat(cli): add
xs headcommand to get head frame for topic - feat(cli): add
xs getcommand to get frame by id
These were straightforward tasks, but still pretty impressive, particularly how natural it was to amend the existing commit to add the corresponding xs.nu change. I tried to get it to update the README example with the 2 new commands, it failed at that though.
I used 565 credits to create these 2 commits (+ the failed README updates).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Check if a command is provided | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: $0 -- <command>" | |
| exit 1 | |
| fi | |
| # Remove the -- separator | |
| shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Hono } from "jsr:@hono/hono"; | |
| const app = new Hono(); | |
| app.get("/", async (c) => { | |
| try { | |
| const indexHtml = await Deno.readTextFile("./index.html"); | |
| return c.html(indexHtml); | |
| } catch (error) { | |
| return c.text("Error loading index.html", 500); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Application, Router } from "https://deno.land/x/oak/mod.ts"; | |
| const app = new Application(); | |
| const router = new Router(); | |
| // Route to serve index.html | |
| router.get("/", async (context) => { | |
| try { | |
| const indexHtml = await Deno.readTextFile("./index.html"); | |
| context.response.headers.set("Content-Type", "text/html"); |