We are excited to introduce a powerful new tool for Quail users—Quail CLI. This command-line interface is designed to simplify and automate the management of your Quail account, allowing you to authenticate, create, and manage posts directly from your terminal. Whether you're a developer who loves working from the command line or just looking for a faster way to interact with your Quail account, Quail CLI is here to help.

What is Quail CLI?

Quail CLI is a command-line tool that enables you to perform key operations on Quail with ease. By interacting directly with the Quail API, it allows you to authenticate users, manage posts, and fetch user details—all through simple commands.

Instead of navigating through the Quail web interface to perform routine tasks, you can now leverage the speed and convenience of the command line to get things done in just a few keystrokes.

Key Features

Here’s a breakdown of what you can do with Quail CLI:

  • Authenticate with OAuth: Securely log in to your Quail account via OAuth right from the terminal.
  • Manage Posts: Easily create, update, publish, unpublish, or delete posts using markdown files.
  • Fetch User Info: Retrieve details about the currently authenticated user.
  • Automate Your Workflow: Use Quail CLI in scripts or batch processes for bulk operations and streamlined publishing.

Getting Started

Getting started with Quail CLI is as easy as installing the tool and running a few simple commands. If you're familiar with Go, you can install it directly using:

$ go install github.com/quail-ink/quail-cli@latest

Once installed, you can begin interacting with your Quail account by running:

$ quail-cli login

This command will prompt you to authenticate with Quail via OAuth. Follow the instructions, and once logged in, you're ready to start managing your posts and retrieving user information.

Managing Posts with Quail CLI

One of the standout features of Quail CLI is its ability to manage posts using markdown files. This makes it perfect for users who already draft their content in markdown. The CLI can automatically handle post creation, updating, and publishing by reading the frontmatter from your markdown files.

Example Markdown Post:

---
title: "Welcome to the Future"
slug: future-tech
datetime: 2024-10-01 10:00
summary: "An introduction to future technology trends."
tags: tech, future, innovation
cover_image_url: "https://example.com/cover.jpg"
---

In this post, we will explore the future of technology and how it's shaping the world...

> "Any sufficiently advanced technology is indistinguishable from magic." 
> — Arthur C. Clarke

# The Future is Now

Let's dive into the innovations...

You can create or update posts using this markdown file with the following command:

$ quail-cli post upsert your_post.md -l your_list_slug

If the post already exists, Quail CLI will update it. If not, it will create a new post for you!

Publishing and More

Publishing posts is just as easy:

$ quail-cli post publish -l your_list_slug -p your_post_slug

With similar commands for unpublishing, delivering, and deleting posts, you can handle all your content management needs without ever leaving your terminal.

Configuration Options

Quail CLI comes with a flexible configuration system that allows you to customize how it interacts with Quail. The configuration is stored in a YAML file, and by default, the CLI looks for it in $HOME/.config/quail-cli/config.yaml.

Here’s an example configuration file:

app:
  access_token: ""
  expiry: ""
  refresh_token: ""
  token_type: ""
post:
  frontmatter_mapping:
    cover_image_url: featureImage

You can map different frontmatter keys to Quail’s post attributes, giving you full control over how your posts are structured and submitted.

Who Should Use Quail CLI?

Whether you're a writer, a developer, or someone who manages multiple newsletters, Quail CLI can help simplify your workflow. If you prefer working in the terminal or need a way to automate tasks like publishing posts, retrieving user data, or managing your content in bulk, this tool is for you.

Developers will appreciate the easy installation process via Go, and writers will love the simplicity of managing posts using markdown files and the terminal.

Contribute to the Project

Quail CLI is open-source, and we welcome contributions from the community. If you encounter any issues or have ideas for new features, feel free to open an issue or submit a pull request on GitHub, or check out our document