Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
allow:
- dependency-type: "direct"
versioning-strategy: increase
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules/
dist/
.env
58 changes: 22 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
## Pulse Editor Terminal
Pulse Editor Terminal is a Pulse Editor terminal extension that allows you to connect to a terminal (e.g. shell, PowerShell, Termux) on your local device.
## Pulse Editor Extension Template
This is a React template which you can use to make your own Pulse Editor extension. It uses Webpack Module Federation to share extensions with Pulse Editor.

## Get Started
### Connect to your device's terminal
#### Desktop
Desktop shell should be automatically connected when you open Pulse Editor on desktop.
#### Android: Setup node-pty in Termux
You have to setup terminal server on your Android device manually, and start it every time you'd need to use this terminal extension on Android.
1. Install Termux, following guide on [Termux's GitHub repo](https://github.com/termux/termux-app). If you prefer a more linux-like interaction using your preferred distro in Termux, you can try out [Androidnix](https://andronix.app/).
2. Install nodejs 22 in Termux.
```
apt update
apt install nodejs-lts
```
1. Clone this [minimal node-pty server repo](https://github.com/ClayPulse/termux-node-pty) used to generate terminal websocket using node-pty.
```bash
git clone https://github.com/ClayPulse/termux-node-pty
cd termux-node-pty
```
2. Install dependencies
### Create Pulse Editor extension app using CLI
```bash
# Install build tools to build native module
apt install -y make python build-essential

# Set android_ndk_path placeholder to avoid build error when installing node-pty
export GYP_DEFINES="android_ndk_path=''"

npm i
```

3. Start node-pty server
```
node node-pty-server.js
# Install Pulse Editor CLI
npm i -g @pulse-editor/cli
# Use CLI to create a React template project (based on this repository)
pulse create
```

4. Fill websocket URL produced by proxy server in Pulse Editor settings. It should be `ws://localhost:6060` by default.

### Start development
#### Method 1: Install your extension in Pulse Editor as a dev extension
Run the following to start a dev server locally.
Expand All @@ -44,12 +17,25 @@ npm run dev
```
This will host your extension at http://localhost:3001 (or you can customize the server host in `webpack.config.ts`). Then in Pulse Editor, go to settings and fill in your extension dev server's information to install you new extension. You will need the following:
- dev server: e.g. http://localhost:3001
- extension id: your extension's ID specified in `pulse.config.ts`
- version: your extension's version specified in `pulse.config.ts`
- extension id: your extension's ID specified in `package.json`
- version: your extension's version specified in `package.json`

#### Method 2: Preview your extension in browser
If you'd like to quickly get started on developing your extension without installing it inside Pulse Editor. You can run a preview dev server that runs in your browser (just like developing React application).
```
npm run preview
```
> Please note that your extension won't be able to use IMC (Inter-Module-Communication) to communicate with Pulse Editor during preview development mode.

## Development
### Add extension source code
Add React code inside `/src` to make your custom component(s) for your extension, `main.tsx` is the main entrance for Pulse Editor Extensions.

### Pulse Editor libraries
You can use shared utils (like types) from `@pulse-editor/shared-utils`.

You can also use React hooks provided by `@pulse-editor/react-api` to interact with Pulse Editor main process. Some examples are:
- Load/write currently opened file.
- Invoke Pulse Editor agents.
- Use AI models.
- Use agentic tools installed in Pulse Editor.
Loading