Skip to content

Commit

Permalink
Add Slumber post
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed May 17, 2024
1 parent 529de6c commit 3916736
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/ImageOpt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const loader: ImageLoader = ({ src }) => {
*/
const ImageOpt: React.FC<Props> = (props) => (
// TODO use alt text from cloudinary
<Image alt="TODO" loader={loader} {...props} />
<Image alt="" loader={loader} {...props} />
);

export default ImageOpt;
14 changes: 7 additions & 7 deletions src/components/post/PostView.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import Head from "next/head";
import { Resize } from "@cloudinary/url-gen/actions";
import { Post } from "@root/lib/api";
import styles from "@root/styles/PostView.module.scss";
import { cloudinary } from "@root/lib/cloudinary";
import { formatDate } from "@root/lib/utils";
import PageContainer from "../PageContainer";
import ImageOpt from "../ImageOpt";
import styles from "@root/styles/PostView.module.scss";
import clsx from "clsx";
import Head from "next/head";
import Link from "next/link";
import { cloudinary } from "@root/lib/cloudinary";
import { Resize } from "@cloudinary/url-gen/actions";
import React from "react";
import ImageOpt from "../ImageOpt";
import PageContainer from "../PageContainer";

interface Props {
metadata: Post["metadata"];
Expand Down
6 changes: 3 additions & 3 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import Head from "next/head";
import "@root/styles/global.scss";
import { MDXProvider } from "@mdx-js/react";
import Code from "@root/components/Code";
import "@root/styles/global.scss";
import Head from "next/head";
import React from "react";

const components: React.ComponentProps<typeof MDXProvider>["components"] = {
code: Code,
Expand Down
1 change: 1 addition & 0 deletions src/pages/posts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export * as mtWashington from "./mt-washington.mdx";
// Projects - these end up sorted alphabetically
export * as laulud from "./laulud.mdx";
export * as osrsCli from "./osrs-cli.mdx";
export * as slumber from "./slumber.mdx";
export * as soze from "./soze.mdx";
export * as terra from "./terra.mdx";
60 changes: 60 additions & 0 deletions src/pages/posts/slumber.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import Images from "@root/components/Images";
import PostView from "@root/components/post/PostView";

export const metadata = {
title: "Slumber: A TUI HTTP Client",
date: "2024-05-17",
summary:
"Slumber is a configuration-first, Terminal User Interface (TUI) HTTP client.",
banner: "lucaspickering.me/slumber/banner.gif",
links: {
Code: "https://github.com/LucasPickering/slumber",
Site: "https://slumber.lucaspickering.me",
Install: "https://slumber.lucaspickering.me/artifacts/",
},
tags: ["post", "project", "rust", "http", "terminal", "tui"],
};

## Try it out

Don't wanna read? Install it now and try it out with any of these:

```
cargo install slumber
brew install LucasPickering/homebrew-tap/slumber
```

[Click here for more install options](https://slumber.lucaspickering.me/artifacts/)

## What is Slumber?

Slumber is a configuration-first, Terminal User Interface (TUI) HTTP client. It's designed to as an alternative to Insomnia, Postman, etc. for those who prefer doing their work in the terminal. The primary principles of the project are:

- It will remain free to use forever
- You own your data: all configuration and data is stored locally and can be checked into version control
- It will never be [enshittified](https://en.wikipedia.org/wiki/Enshittification) (looking at you, Insomnia)

In terms of functionality, I had two main goals in mind during development:

- Make a usable HTTP client, that can serve all of a normal web developer's needs, entirely in the terminal. Terminal apps can be harder to learn, but are generally faster to use once you're familiar. Additionally, they tend to perform better and use fewer resources than a GUI.
- Define configuration first, _outside_ the app. Rather than creating and editing your request definitions in the app, "configuration-first" means you write your configuration in a normal editor, then the app reads it. This has a few benefits:
- You can easily migrate and persist your request collection, since you know exactly where it is. It's not hidden in a system directory or a SQLite database, it's right there in a single YAML file.
- Similarly, you can easily share your collection with others. By defining a collection in a single file, you can check it into version control. This makes it easy not only to share with others who work on the same service or site as you, it makes it easy for new developers to come into a codebase and start making requests.

## Why does Slumber exist?

There are a lot of HTTP/REST clients out there, so why did I bother making a new one? The primary reason is, when I first started the project in August 2023, I couldn't find any other TUI clients. I had been wanting a good TUI project to try out [Ratatui](https://ratatui.rs/), and at the same time I was perpetually dissatisfied with Insomnia. I found it clunky inefficient to use.

Around a month after I started, Kong released Insomnia 8.0, which [required creating an account](https://github.com/Kong/insomnia/discussions/6590) (more or less). Up to that point I was unsure about the future of the project, but that convinced that this needed to be made.

## How do I try it out?

First, head to the [installation page](https://slumber.lucaspickering.me/artifacts/) to install it. Then, jump over to [the docs](https://slumber.lucaspickering.me/book/) to start writing your first request collection.

## Feedback

If you try out Slumber, I'd love to hear your thoughts, whether you love it or hate it. I'm especially interested in feedback on documentation, since this is the hardest thing for me to "test" myself. For bugs and feature requests (including specific requests about documentation), you can [open a GitHub issue](https://github.com/LucasPickering/slumber/issues). For questions and open-ended discussion, open a [GitHub discussion](https://github.com/LucasPickering/slumber/discussions). Alternatively, we have a [Discord](https://discord.gg/G9RbbUsj) where you can leave your feedback or ask questions..

export default ({ children }) => (
<PostView metadata={metadata}>{children}</PostView>
);
1 change: 1 addition & 0 deletions src/styles/Code.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

// Applies only to triple-tick code blocks (not inline)
pre .code {
display: block;
max-width: 100%;
overflow-x: auto;
padding: 8px;
Expand Down

0 comments on commit 3916736

Please sign in to comment.