Skip to content

feat: read the log and profiles from the terminal - #92

Closed
prateekbhujel wants to merge 1 commit into
dev-null-sh:productionfrom
prateekbhujel:feat/log-from-terminal
Closed

prateekbhujel wants to merge 1 commit into
dev-null-sh:productionfrom
prateekbhujel:feat/log-from-terminal

Conversation

@prateekbhujel

@prateekbhujel prateekbhujel commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Hey @nunomaduro! 👋

Now that we can commit straight from the terminal with curl .../commit | bash, opening a browser just to check the log felt like leaving the terminal too soon.

This PR adds terminal reading via content negotiation: when curling devnull endpoints, you get a clean ANSI git graph DAG instead of unrendered HTML.

What this adds

1. curl https://dev-null.sh

  • Guests: Renders a clean ASCII landing page with the /dev/null banner, product intro, and CLI commit instructions.
  • Authenticated: Redirects to your Following log.

2. curl https://dev-null.sh/log (or https://dev-null.sh/log/everyone)

When authenticated, renders the timeline as an ASCII git DAG rail with 24-bit TrueColor user lanes (and 16-color ANSI fallbacks):

$ curl -s https://dev-null.sh/log
   _                     _ _           _     
__| | _____   __  _ __  | | |  ___ ___| |__  
/ _` |/ _ \ \ / / | '_ \ | | | / __/ __| '_ \ 
| (_| |  __/\ V /  | | | || | |_\__ \__ \ | | |
\__,_|\___| \_/   |_| |_| \__(_)___/___/_| |_|

A social network for developers. Pipe your thoughts to /dev/null.

Log: following
────────────────────────────────────────────────────────────

*   0be0130 @nuno · 10m ago · 14 ★
│   Commit to devnull from your terminal: curl -fsSL https://dev-null.sh/commit | bash
│   
*   8fabf34 @xHeaven · 14m ago · 2 ★
│   Damn, that's sick!

────────────────────────────────────────────────────────────
Commit: curl -fsSL https://dev-null.sh/commit | bash -s -- 'Your message'
Log:    curl -s https://dev-null.sh/log

3. curl https://dev-null.sh/@nuno

  • Guests: Displays the public profile card (bio, commit & follower counts) and a sign-in prompt.
  • Authenticated: Displays the profile header along with their recent top-level commit history.

4. curl https://dev-null.sh/@nuno/commits/{id}

  • Guests: Renders the individual commit preview and a sign-in prompt.
  • Authenticated: Renders the full thread with ancestors above and replies expanded below.

Implementation & Architecture

  • TerminalRenderer (app/Services/Terminal/): Zero external dependencies. Maps user lanes to TrueColor (\033[38;2;R;G;Bm) with standard 16-color ANSI fallback (?color=16 or X-Color-Depth: 16), and honors the NO_COLOR specification.
  • Terminal Safety (Sanitization): All user-controlled text (commit bodies, usernames, names, bios) passes through TerminalRenderer::sanitize() to strip ANSI escapes (\033[...]) and C0 control characters, preventing terminal display injection.
  • Product & Auth Alignment: Respects PRODUCT.md by default — unauthenticated curl requests receive landing or preview cards rather than bypassing the login requirement. (If you prefer opening the Everyone log to anonymous CLI curls, we can easily toggle that).
  • RESTful CLI Controller: Added Cli\LogController with a RESTful index() method (passes Pest's Laravel presets and controller isolation rules).
  • Tests & Quality: 862/862 Pest tests passing green, 100.0% type coverage, 0 PHPStan errors, and clean Pint formatting.

@prateekbhujel
prateekbhujel force-pushed the feat/log-from-terminal branch 2 times, most recently from 74bdd87 to 0a8d2a3 Compare October 15, 2026 16:57
@prateekbhujel prateekbhujel changed the title feat: read the log from the terminal and tail -f /dev/null feat: read the log and profiles from the terminal Oct 15, 2026
@nunomaduro
nunomaduro marked this pull request as draft October 15, 2026 17:22
@prateekbhujel
prateekbhujel force-pushed the feat/log-from-terminal branch from 0a8d2a3 to c5c86bc Compare October 15, 2026 17:46
@prateekbhujel
prateekbhujel marked this pull request as ready for review October 15, 2026 17:48
@prateekbhujel
prateekbhujel force-pushed the feat/log-from-terminal branch from c5c86bc to 3f89954 Compare October 15, 2026 18:02
@brendt
brendt requested a review from mnapoli October 16, 2026 09:13
@prateekbhujel
prateekbhujel force-pushed the feat/log-from-terminal branch from 3f89954 to 13bb305 Compare October 16, 2026 09:17
@mnapoli

mnapoli commented Oct 16, 2026

Copy link
Copy Markdown
Member

Thank you! We discussed it and we're gonna go with a complete CLI instead, that will unlock more things

@prateekbhujel

Copy link
Copy Markdown
Contributor Author

Makes complete sense! Took your feedback to heart—instead of curling web routes with content negotiation, I opened #198 adding a dedicated php artisan log command with git DAG rendering and optional native interactive TUI navigation via ext-terminal.

@prateekbhujel
prateekbhujel deleted the feat/log-from-terminal branch October 16, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants