Skip to content

Commit

Permalink
Merge pull request #26 from hyphacoop/rename-cli
Browse files Browse the repository at this point in the history
rename CLI command from dp-cli to dpress
  • Loading branch information
RangerMauve authored Jan 16, 2025
2 parents b412839 + 7b34273 commit e07d694
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pages/deployment/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Distributed Press.

1. [Sutty](/deployment/sutty)
2. [GitHub Actions](/deployment/github-actions)
3. [Distributed Press CLI](../sdk/)
3. [Distributed Press CLI](../dp-cli/)

## Sutty
Sutty provides a content management system (CMS) that allows
Expand Down
8 changes: 5 additions & 3 deletions pages/dp-cli/index.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { Callout } from 'nextra-theme-docs'

# Welcome to Distributed Press CLI
The [Distributed Press CLI (dp-cli)](https://github.com/hyphacoop/distributed-press-cli/) is a powerful command-line tool for interacting with the Distributed Press API and Social Inbox. It enables you to manage websites, register ActivityPub actors, and share updates seamlessly across the Fediverse—all from your terminal.
The [Distributed Press CLI (dpress)](https://github.com/hyphacoop/distributed-press-cli/) is a powerful command-line tool for interacting with the Distributed Press API and Social Inbox. It enables you to manage websites, register ActivityPub actors, and share updates seamlessly across the Fediverse—all from your terminal.

# Two Ways to Publish with Distributed Press CLI
## 1. Publishing Website with Distributed Press API
Using the Distributed Press API, you can publish static websites directly to IPFS, Hypercore, and HTTPS. The `dp-cli` allows you to create a site, upload content, and manage DNS records seamlessly. For instance, after creating a site, you can use the `dp-cli publish` command to upload content from your local directory to the Distributed Press infrastructure. Your site becomes available across decentralized protocols, ensuring global accessibility and resilience.
Using the Distributed Press API, you can publish static websites directly to IPFS, Hypercore, and HTTPS. The `dpress` allows you to create a site, upload content, and manage DNS records seamlessly. For instance, after creating a site, you can use the `dpress publish` command to upload content from your local directory to the Distributed Press infrastructure. Your site becomes available across decentralized protocols, ensuring global accessibility and resilience.

## 2. Sending Posts to the Fediverse via Social Inbox
With the [Social Inbox](/social-inbox) integration, you can share ActivityPub posts to your followers on the Fediverse. By combining `dp-cli` with the [Staticpub template](https://github.com/hyphacoop/staticpub.distributed.press), you can create a website that doubles as an ActivityPub actor. After setting up your actor and registering it with the Social Inbox, use the `dp-cli send-post` command to share posts directly from your terminal, reaching your followers securely and efficiently.
With the [Social Inbox](/social-inbox) integration, you can share ActivityPub posts to your followers on the Fediverse. By combining `dpress` with the [Staticpub template](https://github.com/hyphacoop/staticpub.distributed.press), you can create a website that doubles as an ActivityPub actor. After setting up your actor and registering it with the Social Inbox, use the `dpress send-post` command to share posts directly from your terminal, reaching your followers securely and efficiently.

## Demo Video
> ⚠️ **Disclaimer:** This demo video was recorded using the previous CLI name `dp-cli`. Please use `dpress` for all commands and functionality moving forward.
<video width="280" height="500" src="/img/dp-cli_demo.mp4" controls style={{ display: 'block', margin: '2rem auto', maxWidth: '100%' }} />
20 changes: 10 additions & 10 deletions pages/dp-cli/publish-site.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Register a trial publisher account on Distributed Press using your email:

```bash
dp-cli register
dpress register
```

You will be prompted for your name and email. Note: currently, only one site per email is allowed.
Expand All @@ -15,7 +15,7 @@ You will be prompted for your name and email. Note: currently, only one site per
Obtain your `authToken` from your Distributed Press API administrator and set it using:

```bash
dp-cli set-auth-token
dpress set-auth-token
```

You will be prompted to enter your authentication token.
Expand All @@ -25,15 +25,15 @@ You will be prompted to enter your authentication token.
Once registered, create a new site by specifying the domain name and whether it should be public:

```bash
dp-cli create-site
dpress create-site
```

### Publish Your Site

To upload and publish static content to the DP site from a specified directory:

```bash
dp-cli publish ./folder_here
dpress publish ./folder_here
```

### DNS Setup
Expand Down Expand Up @@ -91,7 +91,7 @@ To use your custom domain, ensure that your domain has a valid HTTPS certificate
Clone a website by creating a static copy from its HTTP URL:

```bash
dp-cli clone <site-id>
dpress clone <site-id>
```

## Configuration
Expand Down Expand Up @@ -127,7 +127,7 @@ Register a trial publisher account with Distributed Press:
**Usage:**

```bash
dp-cli register
dpress register
```

### `set-auth-token`
Expand All @@ -138,7 +138,7 @@ Set your authentication token for API access.
**Usage:**

```bash
dp-cli set-auth-token
dpress set-auth-token
```

**Prompt:**
Expand All @@ -154,7 +154,7 @@ Create a new site by specifying the domain name and whether it should be public
**Usage:**

```bash
dp-cli create-site
dpress create-site
```

**Prompt:**
Expand All @@ -171,7 +171,7 @@ Upload and publish static content to the DP site from a specified directory:
**Usage:**

```bash
dp-cli publish ./folder_here
dpress publish ./folder_here
```

### `clone`
Expand All @@ -183,5 +183,5 @@ Clone a website by creating a static copy from its HTTP URL:
**Usage:**

```bash
dp-cli clone <site-id>
dpress clone <site-id>
```
16 changes: 8 additions & 8 deletions pages/dp-cli/send-posts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ For using the Social Inbox, you need to generate a keypair and register your Act
Run the following command to generate a new RSA keypair:

```bash
dp-cli generate-keypair
dpress generate-keypair
```

**Purpose:**
Expand All @@ -88,7 +88,7 @@ Alternatively, you can use the staticpub's [publish.yml](https://github.com/hyph
Register your ActivityPub actor with the Social Inbox:

```bash
dp-cli register-actor
dpress register-actor
```

This will register your actor with the Social Inbox and save the details to your configuration.
Expand All @@ -98,19 +98,19 @@ This will register your actor with the Social Inbox and save the details to your
Published the template? Now, let's send a post to your followers:

```bash
dp-cli send-post ./path_to_activity.json
dpress send-post ./path_to_activity.json
```

#### Example (as per the staticpub template):
```bash
dp-cli send-post ./posts/helloworld.jsonld
dpress send-post ./posts/helloworld.jsonld
```

### Patch a Site
After publishing your site and registering your actor, you might need to update your site with new content or activities. Use the `patch` command to add the note/activity JSON and update the outbox with the new activity.

```bash
dp-cli patch -i <site-id> ./path_to_patch_folder
dpress patch -i <site-id> ./path_to_patch_folder
```

## Configuration
Expand Down Expand Up @@ -155,7 +155,7 @@ Generate a new RSA keypair and save it to your configuration.
**Usage:**

```bash
dp-cli generate-keypair
dpress generate-keypair
```

### `register-actor`
Expand All @@ -166,7 +166,7 @@ Register your ActivityPub actor with the Social Inbox.
**Usage:**

```bash
dp-cli register-actor
dpress register-actor
```

**Prompts:**
Expand All @@ -185,7 +185,7 @@ dp-cli register-actor
Send an activity post to your followers and publish it on the DP site:

```bash
dp-cli send-post --path ./path_to_activity.json
dpress send-post --path ./path_to_activity.json
```

**Output:**
Expand Down

0 comments on commit e07d694

Please sign in to comment.