/ow

Nextcloud command-line client

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

🦉 ow

ow - Nextcloud command-line client

Introduction

ow (like, you're trying to say "owl" and almost succeed) is your handy local command-line pal for Nextcloud. Perform various operations to enhance local editing, collaboration, and more.

Usage

Help

List available actions.

$ ow --help
usage: ow [-h] [-d] {i,internal-link,l,lock,u,unlock} path

positional arguments:
  {i,internal-link,l,lock,u,unlock}
                        action to perform
  path                  local path to operate on

options:
  -h, --help            show this help message and exit
  -d, --debug           enable debug messages

Output is minimal on success. If an error occurs, messages are printed to standard error and a nonzero exit code is returned.

Get internal link

Given a local file path sync'd by the Nextcloud desktop client, return the "internal link" on the Nextcloud server.

$ ow internal-link ~/Nextcloud/test.md
https://cloud.example.com/f/229

Lock

Lock a file. Requires the Temporary files lock app.

$ ow lock ~/Nextcloud/test.md

Locking indicates to other users your wish to avoid conflicts in shared files.

Unock

Unlock a file. Requires the Temporary files lock app.

$ ow unlock ~/Nextcloud/test.md

Installation

  • install prerequisites
    • Python 3
    • Nextcloud desktop sync client
  • download the main.py script, save it as ow
  • edit values under YOUR CONFIG
  • put the script in your path, for example: ~/bin/ow
  • make sure it is executable
  • for auto-completion in Bash, source bash_completion

Architecture

ow talks with the Nextcloud WebDAV API.

History

ow started with one command (get internal link for locally sync'd file). Hopefully by the time you are reading this it has learned more tricks. If I and others use this, like it, and want to do more with it, here are some ideas on what we might do:

Ideas

  • add more features
    • post chat messages
    • add a task
    • add a calendar event
    • search
  • improve setup
    • automate install
  • improve config
  • improve code maintainability
    • use a real argument parser
    • add tests
  • improve cross-platform compatibility
    • add Windows support
    • add macOS support
  • pick a better name
  • use a real contributor agreement
  • Are there other/better free software utilities like this one? List/promote them.
  • Would it make more sense to implement this and the other feature ideas (above) within the official client? Do the maintainers want these features?
  • support Windows, Linux, macos
    • test on platforms other than Linux
    • add documentation for platforms other than Linux
  • improve Bash programmable completion
    • handle spaces gracefully, like ls Tab or vim Tab
    • get completions from the python script itself so we DRY
    • see also: this, this, and this

COPYLEFT AND LICENSE

  • Copyright ©2023 Adam Monsen haircut@gmail.com
  • License: AGPL v3 or later (see COPYING)