forked from immich-app/immich
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli) Add new CLI (immich-app#3066)
* Add new cli * Remove old readme * Add documentation to readme file * Add github workflow tests for cli * Fix typo in docs * Add usage info to readme * Add package-lock.json * Fix tsconfig * Cleanup * Fix lint * Cleanup package.json * Fix accidental server change * Remove rootdir from cli * Remove tsbuildinfo * Add prettierignore * Make CLI use internal openapi specs * Add ignore and dry-run features * Sort paths alphabetically * Don't remove substring * Remove shorthand for delete * Remove unused import * Remove chokidar * Set correct openapi cli generator script * Add progress bar * Rename target to asset * Add deletion progress bar * Ignore require statement * Use read streams instead of readfile * Fix github feedback * Fix upload requires * More github comments * Cleanup messages * Cleaner pattern concats * Github comments --------- Co-authored-by: Alex Tran <[email protected]>
- Loading branch information
1 parent
37edef8
commit 6f4449d
Showing
53 changed files
with
21,349 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{ts,js}] | ||
quote_type = single | ||
|
||
[*.{md,mdx}] | ||
max_line_length = off | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
quote_type = double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
sourceType: 'module', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin'], | ||
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], | ||
root: true, | ||
env: { | ||
node: true, | ||
jest: true, | ||
}, | ||
ignorePatterns: ['.eslintrc.js'], | ||
rules: { | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'prettier/prettier': 0, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*-debug.log | ||
*-error.log | ||
/.nyc_output | ||
/dist | ||
/lib | ||
/tmp | ||
/yarn.lock | ||
node_modules | ||
oclif.manifest.json | ||
|
||
.vscode | ||
.idea | ||
/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
src/api/open-api | ||
*.md | ||
*.json | ||
coverage | ||
dist | ||
**/migrations/** | ||
|
||
# Ignore files for PNPM, NPM and YARN | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"printWidth": 120, | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
A command-line interface for interfacing with Immich | ||
|
||
# Getting started | ||
|
||
$ ts-node cli/src | ||
|
||
To start using the CLI, you need to login with an API key first: | ||
|
||
$ ts-node cli/src login-key https://your-immich-instance/api your-api-key | ||
|
||
NOTE: This will store your api key under ~/.config/immich/auth.yml | ||
|
||
Next, you can run commands: | ||
|
||
$ ts-node cli/src server-info | ||
|
||
When you're done, log out to remove the credentials from your filesystem | ||
|
||
$ ts-node cli/src logout | ||
|
||
# Usage | ||
|
||
``` | ||
Usage: immich [options] [command] | ||
Immich command line interface | ||
Options: | ||
-h, --help display help for command | ||
Commands: | ||
upload [options] [paths...] Upload assets | ||
import [options] [paths...] Import existing assets | ||
server-info Display server information | ||
login-key [instanceUrl] [apiKey] Login using an API key | ||
help [command] display help for command | ||
``` | ||
|
||
# Todo | ||
|
||
- Sidecar should check both .jpg.xmp and .xmp | ||
- Sidecar check could be case-insensitive | ||
|
||
# Known issues | ||
|
||
- Upload can't use sdk due to multiple issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { Config } from 'jest'; | ||
|
||
const config: Config = { | ||
preset: 'ts-jest', | ||
setupFilesAfterEnv: ['jest-extended/all'], | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.