Skip to content
Closed
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
21 changes: 21 additions & 0 deletions npm/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Test files
test.js
*.test.js

# Development files
.gitignore
.editorconfig

# OS files
.DS_Store
Thumbs.db

# Logs
*.log

# Temporary files
*.tmp
temp/

# Don't include pre-downloaded binaries
bin/
80 changes: 80 additions & 0 deletions npm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# @clickup/cli

Command-line interface for ClickUp - manage tasks, lists, and spaces from your terminal.

## Installation

```bash
npm install -g @clickup/cli
```

Or using yarn:
```bash
yarn global add @clickup/cli
```

## Usage

After installation, the `cu` command will be available globally:

```bash
# Authenticate with ClickUp
cu auth login

# List tasks
cu task list

# Create a new task
cu task create

# View help
cu --help
```

## Features

- **Task Management**: Create, view, update, and manage tasks
- **Bulk Operations**: Efficiently handle multiple tasks at once
- **Multiple Output Formats**: Table, JSON, YAML, and CSV
- **Interactive Mode**: User-friendly prompts for complex operations
- **Cross-Platform**: Works on macOS, Linux, and Windows

## Documentation

For full documentation, visit: https://github.com/timimsms/cu

## Binary Distribution

This npm package automatically downloads the appropriate ClickUp CLI binary for your platform during installation. The binary is downloaded from the official GitHub releases.

### Supported Platforms

- macOS (Intel & Apple Silicon)
- Linux (x64, ARM64, i386)
- Windows (x64, i386)

### Skip Binary Download

If you want to skip the automatic binary download (e.g., in CI environments), set the environment variable:

```bash
CLICKUP_CLI_SKIP_DOWNLOAD=1 npm install -g @clickup/cli
```

## Troubleshooting

If you encounter issues during installation:

1. **Permission errors**: Try using `sudo` (not recommended) or configure npm to use a different directory
2. **Download failures**: Check your internet connection and GitHub access
3. **Platform not supported**: Download the binary manually from [releases](https://github.com/timimsms/cu/releases)

## License

MIT © Tim Timmerman

## Links

- [GitHub Repository](https://github.com/timimsms/cu)
- [Issue Tracker](https://github.com/timimsms/cu/issues)
- [Releases](https://github.com/timimsms/cu/releases)
2 changes: 2 additions & 0 deletions npm/bin/cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../index.js');
70 changes: 70 additions & 0 deletions npm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env node
/**
* ClickUp CLI npm package entry point
* This file handles the execution of the cu binary
*/

const { spawn } = require('child_process');
const path = require('path');
const fs = require('fs');

// Determine the binary name based on platform
const getBinaryName = () => {
const platform = process.platform;
return platform === 'win32' ? 'cu.exe' : 'cu';
};

// Get the path to the binary
const getBinaryPath = () => {
const binaryName = getBinaryName();
const binPath = path.join(__dirname, 'bin', binaryName);

if (!fs.existsSync(binPath)) {
console.error('ClickUp CLI binary not found!');
console.error('Please run: npm install -g @clickup/cli');
console.error('');
console.error('If the problem persists, please report it at:');
console.error('https://github.com/timimsms/cu/issues');
process.exit(1);
}

return binPath;
};

// Main execution
const main = () => {
const binaryPath = getBinaryPath();
const args = process.argv.slice(2);

// Spawn the binary with inherited stdio
const child = spawn(binaryPath, args, {
stdio: 'inherit',
shell: false
});

// Handle exit
child.on('exit', (code) => {
process.exit(code);
});

// Handle errors
child.on('error', (err) => {
if (err.code === 'ENOENT') {
console.error('ClickUp CLI binary not found!');
console.error('Path:', binaryPath);
} else if (err.code === 'EACCES') {
console.error('Permission denied when trying to execute ClickUp CLI');
console.error('Try running: chmod +x', binaryPath);
} else {
console.error('Failed to start ClickUp CLI:', err.message);
}
process.exit(1);
});
};

// Run if called directly
if (require.main === module) {
main();
}

module.exports = { getBinaryPath, getBinaryName };
54 changes: 54 additions & 0 deletions npm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "@clickup/cli",
"version": "0.0.0-development",
"description": "Command-line interface for ClickUp",
"keywords": [
"clickup",
"cli",
"task-management",
"productivity",
"command-line"
],
"homepage": "https://github.com/timimsms/cu",
"bugs": {
"url": "https://github.com/timimsms/cu/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/timimsms/cu.git"
},
"license": "MIT",
"author": "Tim Timmerman <timmerman.tim@gmail.com>",
"main": "index.js",
"bin": {
"cu": "./bin/cu",
"clickup": "./bin/cu"
},
"files": [
"bin/",
"index.js",
"postinstall.js",
"README.md"
],
"scripts": {
"postinstall": "node postinstall.js",
"test": "node test.js"
},
"engines": {
"node": ">=14.0.0"
},
"os": [
"darwin",
"linux",
"win32"
],
"cpu": [
"x64",
"arm64",
"ia32"
],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
Loading