You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@apollo-annotation/apollo-cli

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apollo-annotation/apollo-cli - npm Package Compare versions

Comparing version

to
0.1.1

dist/commands/assembly/add-fasta.d.ts

7

dist/baseCommand.d.ts

@@ -6,3 +6,3 @@ import { Command, Interfaces } from '@oclif/core';

static baseFlags: {
profile: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
profile: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
'config-file': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;

@@ -13,2 +13,7 @@ };

init(): Promise<void>;
private getConfig;
getAccess(configFile: string | undefined, profileName: string | undefined): Promise<{
address: string;
accessToken: string;
}>;
protected catch(err: Error & {

@@ -15,0 +20,0 @@ exitCode?: number;

@@ -0,2 +1,5 @@

import path from 'node:path';
import { Command, Flags } from '@oclif/core';
import { Config, ConfigError } from './Config.js';
import { checkConfigfileExists } from './utils.js';
export class BaseCommand extends Command {

@@ -6,3 +9,2 @@ static baseFlags = {

description: 'Use credentials from this profile',
default: 'default',
}),

@@ -26,2 +28,28 @@ 'config-file': Flags.string({

}
getConfig(configFile) {
if (configFile === undefined) {
configFile = path.join(this.config.configDir, 'config.yaml');
}
checkConfigfileExists(configFile);
const config = new Config(configFile);
return config;
}
async getAccess(configFile, profileName) {
const config = this.getConfig(configFile);
if (profileName === undefined) {
profileName = process.env.APOLLO_PROFILE ?? 'default';
}
try {
return await config.getAccess(profileName);
}
catch (error) {
if (error instanceof ConfigError) {
this.logToStderr(error.message);
this.exit(1);
}
else {
throw error;
}
}
}
async catch(err) {

@@ -28,0 +56,0 @@ // add any custom logic to handle errors from the command

import { BaseCommand } from '../baseCommand.js';
export default class ApolloConfig extends BaseCommand<typeof ApolloConfig> {
static summary: string;
static description: string;

@@ -10,3 +11,8 @@ static args: {

profile: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
'get-config-file': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
};
static examples: {
description: string;
command: string;
}[];
run(): Promise<void>;

@@ -13,0 +19,0 @@ private interactiveSetup;

55

dist/commands/config.js

@@ -6,7 +6,12 @@ import path from 'node:path';

import { Args, Flags } from '@oclif/core';
import { fetch } from 'undici';
import { BaseCommand } from '../baseCommand.js';
import { Config, KEYS } from '../Config.js';
import { ConfigError } from '../utils.js';
import { Config, ConfigError, KEYS, optionDesc } from '../Config.js';
import { createFetchErrorMessage, localhostToAddress, wrapLines, } from '../utils.js';
export default class ApolloConfig extends BaseCommand {
static description = 'Get or set Apollo configuration options';
static summary = 'Get or set apollo configuration options';
static description = wrapLines(`Use this command to create or edit a user profile with credentials to access Apollo. \
Configuration options are:
${optionDesc().join('\n\n')}`);
static args = {

@@ -27,3 +32,20 @@ key: Args.string({

}),
'get-config-file': Flags.boolean({
description: 'Return the path to the config file and exit (this file may not exist yet)',
}),
};
static examples = [
{
description: 'Interactive setup:',
command: '<%= config.bin %> <%= command.id %>',
},
{
description: 'Setup with key/value pairs:',
command: '<%= config.bin %> <%= command.id %> --profile admin address http://localhost:3999',
},
{
description: 'Get current address for default profile:',
command: '<%= config.bin %> <%= command.id %> address',
},
];
async run() {

@@ -33,4 +55,9 @@ const { args } = await this.parse(ApolloConfig);

let configFile = flags['config-file'];
if (configFile === undefined) {
configFile = path.join(this.config.configDir, 'config.yaml');
configFile =
configFile === undefined
? path.join(this.config.configDir, 'config.yaml')
: path.resolve(configFile);
if (flags['get-config-file']) {
this.log(configFile);
this.exit(0);
}

@@ -42,3 +69,6 @@ const config = new Config(configFile);

else {
let profileName = 'default';
let profileName = flags.profile;
if (profileName === undefined) {
profileName = process.env.APOLLO_PROFILE ?? 'default';
}
if (flags.profile !== undefined) {

@@ -171,10 +201,13 @@ profileName = flags.profile;

async getLoginTypes(address) {
try {
const response = await fetch(`${address}/auth/types`);
return await response.json();
const response = await fetch(localhostToAddress(`${address}/auth/types`));
if (!response.ok) {
const errorMessage = await createFetchErrorMessage(response, `Unable to retrieve login types for address: "${address}"\n`);
throw new Error(errorMessage);
}
catch {
throw new ConfigError(`Unable to retrieve login types for address: "${address}"`);
const dat = await response.json();
if (Array.isArray(dat)) {
return dat;
}
throw new Error(`Unexpected object: ${JSON.stringify(dat)}`);
}
}

@@ -144,15 +144,2 @@ import fs from 'node:fs';

});
// describe('apollo config: Friendly error with invalid configfile', () => {
// const cmd = ['config', '--config-file', `${TEST_DATA_DIR}/invalid.yaml`]
// test
// .stderr()
// .command(cmd, { root: dirname(dirname(__dirname)) })
// .exit(1)
// .do((output) =>
// expect(output.stderr).to.contain(
// 'Configuration file is probably malformed',
// ),
// )
// .it(cmd.join(' '))
// })
describe('apollo config: Write config file from scratch', () => {

@@ -159,0 +146,0 @@ after(() => {

import { BaseCommand } from '../baseCommand.js';
export default class Login extends BaseCommand<typeof Login> {
static summary: string;
static description: string;
static examples: {
description: string;
command: string;
}[];
static flags: {

@@ -9,2 +14,3 @@ address: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;

force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
port: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
};

@@ -11,0 +17,0 @@ run(): Promise<void>;

@@ -7,7 +7,21 @@ import EventEmitter from 'node:events';

import open from 'open';
import { fetch } from 'undici';
import { BaseCommand } from '../baseCommand.js';
import { Config } from '../Config.js';
import { ConfigError, basicCheckConfig, getUserCredentials, waitFor, } from '../utils.js';
import { Config, ConfigError } from '../Config.js';
import { basicCheckConfig, createFetchErrorMessage, getUserCredentials, localhostToAddress, waitFor, wrapLines, } from '../utils.js';
export default class Login extends BaseCommand {
static description = 'Log in to Apollo';
static summary = 'Login to Apollo';
static description = wrapLines('Use the provided credentials to obtain and save the token to access Apollo. Once the token for \
the given profile has been saved in the configuration file, users do not normally need to execute \
this command again unless the token has expired. To setup a new profile use "apollo config"');
static examples = [
{
description: wrapLines('The most basic and probably most typical usage is to login using the default profile in configuration file:'),
command: '<%= config.bin %> <%= command.id %>',
},
{
description: wrapLines('Login with a different profile:'),
command: '<%= config.bin %> <%= command.id %> --profile my-profile',
},
];
static flags = {

@@ -33,2 +47,6 @@ address: Flags.string({

}),
port: Flags.integer({
description: 'Get token by listening to this port number (usually this is >= 1024 and < 65536)',
default: 3000,
}),
};

@@ -41,4 +59,8 @@ async run() {

}
let profileName = flags.profile;
if (profileName === undefined) {
profileName = process.env.APOLLO_PROFILE ?? 'default';
}
try {
basicCheckConfig(configFile, flags.profile);
basicCheckConfig(configFile, profileName);
}

@@ -52,4 +74,4 @@ catch (error) {

const config = new Config(configFile);
const accessType = config.get('accessType', flags.profile);
const address = flags.address ?? config.get('address', flags.profile);
const accessType = config.get('accessType', profileName);
const address = flags.address ?? config.get('address', profileName);
if (address === undefined) {

@@ -65,6 +87,4 @@ this.logToStderr('Address to apollo must be set');

if (accessType === 'root' || flags.username !== undefined) {
const username = flags.username ??
config.get('rootCredentials.username', flags.profile);
const password = flags.password ??
config.get('rootCredentials.password', flags.profile);
const username = flags.username ?? config.get('rootCredentials.username', profileName);
const password = flags.password ?? config.get('rootCredentials.password', profileName);
if (username === undefined || password === undefined) {

@@ -84,3 +104,3 @@ this.logToStderr('Username and password must be set');

else {
userCredentials = await this.startAuthorizationCodeFlow(address, accessType);
userCredentials = await this.startAuthorizationCodeFlow(address, accessType, flags.port);
}

@@ -94,3 +114,3 @@ }

else if (error instanceof Error) {
this.logToStderr(error.message);
this.logToStderr(error.stack);
ux.action.stop(error.message);

@@ -100,3 +120,3 @@ this.exit(1);

}
config.set('accessToken', userCredentials.accessToken, flags.profile);
config.set('accessToken', userCredentials.accessToken, profileName);
config.writeConfigFile();

@@ -119,3 +139,3 @@ }

async startRootLogin(address, username, password) {
const url = `${address}/auth/root`;
const url = localhostToAddress(`${address}/auth/root`);
const response = await fetch(url, {

@@ -127,10 +147,13 @@ headers: { 'Content-Type': 'application/json' },

if (!response.ok) {
// FIXME: Better error handling
throw new Error('Failed to post request');
const errorMessage = await createFetchErrorMessage(response, 'startRootLogin failed');
throw new Error(errorMessage);
}
const dat = await response.json();
return { accessToken: dat.token };
if (typeof dat === 'object' && dat !== null && 'token' in dat) {
return { accessToken: dat.token };
}
throw new Error(`Unexpected response: ${JSON.stringify(dat)}`);
}
async startGuestLogin(address) {
const url = `${address}/auth/login?type=guest`;
const url = localhostToAddress(`${address}/auth/login?type=guest`);
const response = await fetch(url, {

@@ -140,12 +163,13 @@ headers: { 'Content-Type': 'application/json' },

if (!response.ok) {
// FIXME: Better error handling
throw new Error('Failed to post request');
const errorMessage = await createFetchErrorMessage(response, 'startGuestLogin failed');
throw new Error(errorMessage);
}
const dat = await response.json();
return { accessToken: dat.token };
if (typeof dat === 'object' && dat !== null && 'token' in dat) {
return { accessToken: dat.token };
}
throw new Error(`Unexpected response: ${JSON.stringify(dat)}`);
}
async startAuthorizationCodeFlow(address, accessType) {
async startAuthorizationCodeFlow(address, accessType, port) {
const callbackPath = '/';
const port = 3000;
const authorizationCodeURL = `${address}/auth/login?type=${accessType}&redirect_uri=http://localhost:${port}${callbackPath}`;
// eslint-disable-next-line unicorn/prefer-event-target

@@ -159,3 +183,3 @@ const emitter = new EventEmitter();

emitter.emit(eventName, params);
res.end('You can close this browser now.');
res.end('This browser window was opened by `apollo login`, you can close it now.');
res.socket?.end();

@@ -172,3 +196,16 @@ res.socket?.destroy();

.listen(port);
await ux.anykey('Press any key to open your browser');
server.on('error', async (e) => {
if (e.message.includes('EADDRINUSE')) {
this.logToStderr(`It appears that port ${port} is in use. Perhaps you have JBrowse running?\nTry using a different port using the --port option or temporarily stop JBrowse`);
// eslint-disable-next-line unicorn/no-process-exit
process.exit(1);
}
else {
this.logToStderr(e.message);
// eslint-disable-next-line unicorn/no-process-exit
process.exit(1);
}
});
// await ux.anykey('Press any key to open your browser') // Do we need this?
const authorizationCodeURL = `${address}/auth/login?type=${accessType}&redirect_uri=http://localhost:${port}${callbackPath}`;
await open(authorizationCodeURL);

@@ -175,0 +212,0 @@ ux.action.start('Waiting for authentication');

import { BaseCommand } from '../baseCommand.js';
export default class Logout extends BaseCommand<typeof Logout> {
static summary: string;
static description: string;
static examples: {
description: string;
command: string;
}[];
run(): Promise<void>;
}
import path from 'node:path';
import { BaseCommand } from '../baseCommand.js';
import { Config, KEYS } from '../Config.js';
import { ConfigError, basicCheckConfig } from '../utils.js';
import { Config, ConfigError, KEYS } from '../Config.js';
import { basicCheckConfig, wrapLines } from '../utils.js';
export default class Logout extends BaseCommand {
static description = 'Log out of Apollo';
static summary = 'Logout of Apollo';
static description = wrapLines('Logout by removing the access token from the selected profile');
static examples = [
{
description: 'Logout default profile:',
command: '<%= config.bin %> <%= command.id %>',
},
{
description: 'Logout selected profile',
command: '<%= config.bin %> <%= command.id %> --profile my-profile',
},
];
async run() {
const { flags } = await this.parse(Logout);
let profileName = flags.profile;
if (profileName === undefined) {
profileName = process.env.APOLLO_PROFILE ?? 'default';
}
let configFile = flags['config-file'];

@@ -14,3 +29,3 @@ if (configFile === undefined) {

try {
basicCheckConfig(configFile, flags.profile);
basicCheckConfig(configFile, profileName);
}

@@ -24,5 +39,5 @@ catch (error) {

const config = new Config(configFile);
config.set(KEYS.accessToken, '', flags.profile);
config.set(KEYS.accessToken, '', profileName);
config.writeConfigFile();
}
}
import { BaseCommand } from '../baseCommand.js';
export default class Status extends BaseCommand<typeof Status> {
static summary: string;
static description: string;
run(): Promise<void>;
}
import path from 'node:path';
import { BaseCommand } from '../baseCommand.js';
import { Config, KEYS } from '../Config.js';
import { ConfigError, basicCheckConfig } from '../utils.js';
import { Config, ConfigError, KEYS } from '../Config.js';
import { basicCheckConfig, wrapLines } from '../utils.js';
export default class Status extends BaseCommand {
static description = 'View authentication status';
static summary = 'View authentication status';
static description = wrapLines('This command returns "<profile>: Logged in" if the selected profile has an access token and "<profile>: Logged out" otherwise.\
Note that this command does not check the validity of the access token.');
async run() {
const { flags } = await this.parse(Status);
let profileName = flags.profile;
if (profileName === undefined) {
profileName = process.env.APOLLO_PROFILE ?? 'default';
}
let configFile = flags['config-file'];

@@ -14,3 +20,3 @@ if (configFile === undefined) {

try {
basicCheckConfig(configFile, flags.profile);
basicCheckConfig(configFile, profileName);
}

@@ -24,10 +30,10 @@ catch (error) {

const config = new Config(configFile);
const accessToken = config.get(KEYS.accessToken, flags.profile);
const accessToken = config.get(KEYS.accessToken, profileName);
if (accessToken === undefined || accessToken.trim() === '') {
this.log('Logged out');
this.log(`${profileName}: Logged out`);
}
else {
this.log('Logged in');
this.log(`${profileName}: Logged in`);
}
}
}
import Joi from 'joi';
export declare class ConfigError extends Error {
}
interface BaseProfile {

@@ -22,2 +24,3 @@ address: string;

}
export declare function optionDesc(): string[];
export declare class Config {

@@ -35,4 +38,8 @@ private configFile;

validate(): Joi.ValidationResult;
getAccess(profileName: string): Promise<{
address: string;
accessToken: string;
}>;
toString(): string;
}
export {};

@@ -5,3 +5,5 @@ import fs from 'node:fs';

import YAML, { YAMLParseError } from 'yaml';
import { ConfigError } from './utils.js';
import { checkProfileExists, queryApollo } from './utils.js';
export class ConfigError extends Error {
}
export var KEYS;

@@ -15,7 +17,60 @@ (function (KEYS) {

})(KEYS || (KEYS = {}));
function optionDocs() {
const docs = [];
for (const v of Object.values(KEYS)) {
switch (v) {
case 'address': {
docs.push({
key: v,
description: 'Address and port e.g http://localhost:3999',
});
break;
}
case 'accessType': {
docs.push({
key: v,
description: 'How to access Apollo. accessType is typically one of: google, microsoft, guest, root. Allowed types depend on your Apollo setup',
});
break;
}
case 'accessToken': {
docs.push({
key: v,
description: 'Access token. Usually inserted by `apollo login`',
});
break;
}
case 'rootCredentials.username': {
docs.push({
key: v,
description: 'Username of root account. Only set this for "root" access type',
});
break;
}
case 'rootCredentials.password': {
docs.push({
key: v,
description: 'Password for root account. Only set this for "root" access type',
});
break;
}
default: {
throw new ConfigError(`Unexpected key: ${v}`);
}
}
}
return docs;
}
export function optionDesc() {
const docs = [];
for (const x of optionDocs()) {
docs.push(`- ${x.key}:\n${x.description}`);
}
return docs;
}
function isValidAddress(address) {
const port = address.split(':').pop();
if (port === undefined || /^\d+$/.test(port) === false) {
return false;
}
// const port: string | undefined = address.split(':').pop()
// if (port === undefined || /^\d+$/.test(port) === false) {
// return false
// }
let url;

@@ -151,2 +206,15 @@ try {

}
async getAccess(profileName) {
checkProfileExists(profileName, this);
const address = this.get('address', profileName);
if (address === undefined || address.trim() === '') {
throw new ConfigError(`Profile "${profileName}" has no address. Please run "apollo config" to set it up.`);
}
const accessToken = this.get('accessToken', profileName);
if (accessToken === undefined || accessToken.trim() === '') {
throw new ConfigError(`Profile "${profileName}" has no access token. Please run "apollo login" to set it up.`);
}
await queryApollo(address, accessToken, 'assemblies');
return { address, accessToken };
}
toString() {

@@ -153,0 +221,0 @@ return YAML.stringify(this.profiles);

@@ -6,3 +6,3 @@ export declare const TEST_DATA_DIR: string;

export declare function copyFile(src: string, dest: string, verbose: boolean): void;
export declare function mochaGlobalSetup(): Promise<void>;
export declare function mochaGlobalTeardown(): Promise<void>;
export declare function mochaGlobalSetup(): void;
export declare function mochaGlobalTeardown(): void;

@@ -22,4 +22,3 @@ import fs from 'node:fs';

if (verbose) {
// eslint-disable-next-line no-console
console.log(msg);
process.stdout.write(`${msg}\n`);
}

@@ -32,13 +31,12 @@ }

const msg = `cp ${src} ${dest}`;
// eslint-disable-next-line no-console
console.log(`${msg} # Copied: ${fs.existsSync(dest)}`);
process.stdout.write(`${msg} # Copied: ${fs.existsSync(dest)}\n`);
}
}
export async function mochaGlobalSetup() {
// Temporarily remove config file, if any
export function mochaGlobalSetup() {
process.stdout.write(`Temporarily remove config file ${CONFIG_FILE} if any`);
renameFile(CONFIG_FILE, CONFIG_BAK, VERBOSE);
}
export async function mochaGlobalTeardown() {
// Put config file back
export function mochaGlobalTeardown() {
process.stdout.write(`Putting back config file ${CONFIG_FILE} if any\n`);
renameFile(CONFIG_BAK, CONFIG_FILE, VERBOSE);
}
import EventEmitter from 'node:events';
import { Response } from 'undici';
import { Config } from './Config.js';
export declare const CLI_SERVER_ADDRESS = "http://127.0.0.1:5657";
export declare const CLI_SERVER_ADDRESS_CALLBACK = "http://127.0.0.1:5657/auth/callback";
export declare class ConfigError extends Error {
export declare class CheckError extends Error {
}

@@ -9,3 +11,21 @@ export interface UserCredentials {

}
export declare function createFetchErrorMessage(response: Response, additionalText?: string): Promise<string>;
export declare function checkConfigfileExists(configFile: string): void;
export declare function checkProfileExists(profileName: string, config: Config): void;
export declare function basicCheckConfig(configFile: string, profileName: string): void;
/**
* @deprecated Use this function while we wait to resolve the TypeError when using localhost in fetch.
*/
export declare function localhostToAddress(url: string): string;
export declare function deleteAssembly(address: string, accessToken: string, assemblyId: string): Promise<void>;
export declare function getAssembly(address: string, accessToken: string, assemblyNameOrId: string): Promise<object>;
export declare function getRefseqId(address: string, accessToken: string, refseqNameOrId?: string, inAssemblyNameOrId?: string): Promise<string[]>;
export declare function convertCheckNameToId(address: string, accessToken: string, namesOrIds: string[]): Promise<string[]>;
export declare function assemblyNameToIdDict(address: string, accessToken: string): Promise<Record<string, string>>;
/** In input array namesOrIds, substitute common names with internal IDs */
export declare function convertAssemblyNameToId(address: string, accessToken: string, namesOrIds: string[], verbose?: boolean, removeDuplicates?: boolean): Promise<string[]>;
export declare function getFeatureById(address: string, accessToken: string, id: string): Promise<Response>;
export declare function getAssemblyFromRefseq(address: string, accessToken: string, refSeq: string): Promise<string>;
export declare function queryApollo(address: string, accessToken: string, endpoint: string): Promise<Response>;
export declare function filterJsonList(json: object[], keep: string[], key: string): object[];
export declare const getUserCredentials: () => UserCredentials | null;

@@ -18,1 +38,19 @@ export declare const generatePkceChallenge: () => {

export declare const waitFor: <T>(eventName: string, emitter: EventEmitter) => Promise<T>;
interface bodyLocalFile {
assemblyName: string;
typeName: string;
fileId: string;
}
interface bodyExternalFile {
assemblyName: string;
typeName: string;
externalLocation: {
fa: string;
fai: string;
};
}
export declare function submitAssembly(address: string, accessToken: string, body: bodyLocalFile | bodyExternalFile, force: boolean): Promise<Response>;
export declare function uploadFile(address: string, accessToken: string, file: string, type: string): Promise<string>;
export declare function wrapLines(s: string, length?: number): string;
export declare function idReader(input: string[], removeDuplicates?: boolean): string[];
export {};

@@ -5,9 +5,21 @@ import * as crypto from 'node:crypto';

import * as path from 'node:path';
import { Config } from './Config.js';
import { Agent, FormData, Response, fetch } from 'undici';
import { Config, ConfigError } from './Config.js';
const CONFIG_PATH = path.resolve(os.homedir(), '.clirc');
export const CLI_SERVER_ADDRESS = 'http://127.0.0.1:5657';
export const CLI_SERVER_ADDRESS_CALLBACK = `${CLI_SERVER_ADDRESS}/auth/callback`;
export class ConfigError extends Error {
export class CheckError extends Error {
}
function checkConfigfileExists(configFile) {
export async function createFetchErrorMessage(response, additionalText) {
let errorMessage;
try {
errorMessage = await response.text();
}
catch {
errorMessage = '';
}
const responseMessage = `${response.status} ${response.statusText}${errorMessage ? ` (${errorMessage})` : ''}`;
return `${additionalText ? `${additionalText} — ` : ''}${responseMessage}`;
}
export function checkConfigfileExists(configFile) {
if (!fs.existsSync(configFile)) {

@@ -17,3 +29,3 @@ throw new ConfigError(`Configuration file "${configFile}" does not exist. Please run "apollo config" first`);

}
function checkProfileExists(profileName, config) {
export function checkProfileExists(profileName, config) {
if (!config.getProfileNames().includes(profileName)) {

@@ -28,7 +40,183 @@ throw new ConfigError(`Profile "${profileName}" does not exist. Please run "apollo config" to set this profile up or choose a different profile`);

}
// export const saveUserCredentials = (data: UserCredentials): void => {
// fs.writeFileSync(CONFIG_PATH, JSON.stringify(data, null, 2), {
// encoding: 'utf8',
// })
// }
/**
* @deprecated Use this function while we wait to resolve the TypeError when using localhost in fetch.
*/
export function localhostToAddress(url) {
/** This is hacked function that should become redundant: On my MacOS (?)
* localhost must be converted to address otherwise fetch throws TypeError
* */
return url.replace('//localhost', '127.0.0.1');
}
export async function deleteAssembly(address, accessToken, assemblyId) {
const body = {
typeName: 'DeleteAssemblyChange',
assembly: assemblyId,
};
const auth = {
method: 'POST',
body: JSON.stringify(body),
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
};
const url = new URL(localhostToAddress(`${address}/changes`));
const response = await fetch(url, auth);
if (!response.ok) {
const errorMessage = await createFetchErrorMessage(response, 'deleteAssembly failed');
throw new Error(errorMessage);
}
}
export async function getAssembly(address, accessToken, assemblyNameOrId) {
const assemblyId = await convertAssemblyNameToId(address, accessToken, [assemblyNameOrId]);
if (assemblyId.length === 0) {
return {};
}
const res = await queryApollo(address, accessToken, 'assemblies');
const assemblies = (await res.json());
let assemblyObj = {};
for (const x of assemblies) {
if (x['_id'] === assemblyId[0]) {
assemblyObj = JSON.parse(JSON.stringify(x));
break;
}
}
return assemblyObj;
}
export async function getRefseqId(address, accessToken, refseqNameOrId, inAssemblyNameOrId) {
if (refseqNameOrId === undefined && inAssemblyNameOrId === undefined) {
throw new Error('Please provide refseq and/or assembly');
}
if (inAssemblyNameOrId === undefined) {
inAssemblyNameOrId = '';
}
let assemblyId = [];
if (inAssemblyNameOrId !== '') {
assemblyId = await convertAssemblyNameToId(address, accessToken, [
inAssemblyNameOrId,
]);
if (assemblyId.length !== 1) {
throw new Error(`Assembly name or assembly id returned ${assemblyId.length} assemblies instead of just one`);
}
}
const res = await queryApollo(address, accessToken, 'refSeqs');
const refSeqs = (await res.json());
const refseqIds = [];
const nAssemblies = new Set();
for (const x of refSeqs) {
const aid = x['assembly'];
const rid = x['_id'];
const rname = x['name'];
if (refseqNameOrId === rid ||
refseqNameOrId === rname ||
refseqNameOrId === undefined) {
if (inAssemblyNameOrId === '' || assemblyId.includes(aid)) {
refseqIds.push(rid);
nAssemblies.add(aid);
}
else {
//
}
}
if (nAssemblies.size > 1) {
throw new Error(`Sequence name "${refseqNameOrId}" found in more than one assembly`);
}
}
return refseqIds;
}
async function checkNameToIdDict(address, accessToken) {
const asm = await queryApollo(address, accessToken, 'checks/types');
const ja = (await asm.json());
const nameToId = {};
for (const x of ja) {
const name = x['name'];
nameToId[name] = x['_id'];
}
return nameToId;
}
export async function convertCheckNameToId(address, accessToken, namesOrIds) {
const nameToId = await checkNameToIdDict(address, accessToken);
const ids = [];
for (const x of namesOrIds) {
if (nameToId[x] !== undefined) {
ids.push(nameToId[x]);
}
else if (Object.values(nameToId).includes(x)) {
ids.push(x);
}
else {
throw new CheckError(`Check name or id "${x}" not found`);
}
}
return ids;
}
export async function assemblyNameToIdDict(address, accessToken) {
const asm = await queryApollo(address, accessToken, 'assemblies');
const ja = (await asm.json());
const nameToId = {};
for (const x of ja) {
nameToId[x['name']] = x['_id'];
}
return nameToId;
}
/** In input array namesOrIds, substitute common names with internal IDs */
export async function convertAssemblyNameToId(address, accessToken, namesOrIds, verbose = true, removeDuplicates = true) {
const nameToId = await assemblyNameToIdDict(address, accessToken);
let ids = [];
for (const x of namesOrIds) {
if (nameToId[x] !== undefined) {
ids.push(nameToId[x]);
}
else if (Object.values(nameToId).includes(x)) {
ids.push(x);
}
else if (verbose) {
process.stderr.write(`Warning: Omitting unknown assembly: "${x}"\n`);
}
}
if (removeDuplicates) {
ids = [...new Set(ids)];
}
return ids;
}
export async function getFeatureById(address, accessToken, id) {
const url = new URL(localhostToAddress(`${address}/features/${id}`));
const auth = {
headers: {
authorization: `Bearer ${accessToken}`,
},
};
const response = await fetch(url, auth);
return response;
}
export async function getAssemblyFromRefseq(address, accessToken, refSeq) {
const refSeqs = await queryApollo(address, accessToken, 'refSeqs');
const refJson = filterJsonList((await refSeqs.json()), [refSeq], '_id');
return refJson[0]['assembly'];
}
export async function queryApollo(address, accessToken, endpoint) {
const auth = {
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
};
const url = new URL(localhostToAddress(`${address}/${endpoint}`));
const response = await fetch(url, auth);
if (!response.ok) {
const errorMessage = await createFetchErrorMessage(response, 'queryApollo failed');
throw new ConfigError(errorMessage);
}
return response;
}
export function filterJsonList(json, keep, key) {
const unique = new Set(keep);
const results = [];
for (const x of json) {
if (Object.keys(x).includes(key) && unique.has(x[key])) {
results.push(x);
}
}
return results;
}
export const getUserCredentials = () => {

@@ -68,1 +256,117 @@ try {

};
export async function submitAssembly(address, accessToken, body, force) {
const assemblies = await queryApollo(address, accessToken, 'assemblies');
for (const x of (await assemblies.json())) {
if (x['name'] === body.assemblyName) {
if (force) {
await deleteAssembly(address, accessToken, x['_id']);
}
else {
throw new Error(`Error: Assembly "${body.assemblyName}" already exists`);
}
}
}
const controller = new AbortController();
setTimeout(() => {
controller.abort();
}, 24 * 60 * 60 * 1000);
const auth = {
method: 'POST',
body: JSON.stringify(body),
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
signal: controller.signal,
};
const url = new URL(localhostToAddress(`${address}/changes`));
const response = await fetch(url, auth);
if (!response.ok) {
const errorMessage = await createFetchErrorMessage(response, 'submitAssembly failed');
throw new ConfigError(errorMessage);
}
return response;
}
export async function uploadFile(address, accessToken, file, type) {
const stream = fs.createReadStream(file, 'utf8');
const fileStream = new Response(stream);
const fileBlob = await fileStream.blob();
const formData = new FormData();
formData.append('type', type);
formData.append('file', fileBlob);
const auth = {
method: 'POST',
body: formData,
headers: {
Authorization: `Bearer ${accessToken}`,
},
dispatcher: new Agent({
keepAliveTimeout: 10 * 60 * 1000,
keepAliveMaxTimeout: 10 * 60 * 1000, // 10 minutes
}),
};
const url = new URL(localhostToAddress(`${address}/files`));
try {
const response = await fetch(url, auth);
if (!response.ok) {
const errorMessage = await createFetchErrorMessage(response, 'uploadFile failed');
throw new ConfigError(errorMessage);
}
const json = (await response.json());
return json['_id'];
}
catch (error) {
console.error(error);
throw error;
}
}
/* Wrap text to max `length` per line */
export function wrapLines(s, length) {
if (length === undefined) {
length = 80;
}
// Credit: https://stackoverflow.com/questions/14484787/wrap-text-in-javascript
const re = new RegExp(`(?![^\\n]{1,${length}}$)([^\\n]{1,${length}})\\s`, 'g');
s = s.replaceAll(/ +/g, ' ');
const wr = s.replace(re, '$1\n');
return wr;
}
export function idReader(input, removeDuplicates = true) {
let ids = [];
for (const xin of input) {
let data;
if (xin == '-') {
data = fs.readFileSync('/dev/stdin').toString();
}
else if (fs.existsSync(xin)) {
data = fs.readFileSync(xin).toString();
}
else {
data = xin;
}
try {
data = JSON.parse(data);
if (data.length === undefined) {
data = [data];
}
for (const x of data) {
const id = x['_id'];
if (id !== undefined) {
ids.push(id);
}
}
}
catch {
for (let x of data.split('\n')) {
x = x.trim();
if (x !== '') {
ids.push(x);
}
}
}
}
if (removeDuplicates) {
ids = [...new Set(ids)];
}
return ids;
}

@@ -15,3 +15,17 @@ {

},
"description": "Get or set Apollo configuration options",
"description": "Use this command to create or edit a user profile with credentials to access\nApollo. Configuration options are:\n\n - address:\nAddress and port e.g http://localhost:3999\n\n- accessType:\nHow to access Apollo. accessType is typically one of: google, microsoft, guest,\nroot. Allowed types depend on your Apollo setup\n\n- accessToken:\nAccess token. Usually inserted by `apollo login`\n\n- rootCredentials.username:\nUsername of root account. Only set this for \"root\" access type\n\n- rootCredentials.password:\nPassword for root account. Only set this for \"root\" access type",
"examples": [
{
"description": "Interactive setup:",
"command": "<%= config.bin %> <%= command.id %>"
},
{
"description": "Setup with key/value pairs:",
"command": "<%= config.bin %> <%= command.id %> --profile admin address http://localhost:3999"
},
{
"description": "Get current address for default profile:",
"command": "<%= config.bin %> <%= command.id %> address"
}
],
"flags": {

@@ -32,2 +46,8 @@ "profile": {

"type": "option"
},
"get-config-file": {
"description": "Return the path to the config file and exit (this file may not exist yet)",
"name": "get-config-file",
"allowNo": false,
"type": "boolean"
}

@@ -42,2 +62,3 @@ },

"strict": true,
"summary": "Get or set apollo configuration options",
"enableJsonFlag": false,

@@ -54,3 +75,13 @@ "isESM": true,

"args": {},
"description": "Log in to Apollo",
"description": "Use the provided credentials to obtain and save the token to access Apollo. Once\nthe token for the given profile has been saved in the configuration file, users\ndo not normally need to execute this command again unless the token has expired.\nTo setup a new profile use \"apollo config\"",
"examples": [
{
"description": "The most basic and probably most typical usage is to login using the default\nprofile in configuration file:",
"command": "<%= config.bin %> <%= command.id %>"
},
{
"description": "Login with a different profile:",
"command": "<%= config.bin %> <%= command.id %> --profile my-profile"
}
],
"flags": {

@@ -60,3 +91,2 @@ "profile": {

"name": "profile",
"default": "default",
"hasDynamicHelp": false,

@@ -106,2 +136,10 @@ "multiple": false,

"type": "boolean"
},
"port": {
"description": "Get token by listening to this port number (usually this is >= 1024 and < 65536)",
"name": "port",
"default": 3000,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}

@@ -116,2 +154,3 @@ },

"strict": true,
"summary": "Login to Apollo",
"enableJsonFlag": false,

@@ -128,3 +167,13 @@ "isESM": true,

"args": {},
"description": "Log out of Apollo",
"description": "Logout by removing the access token from the selected profile",
"examples": [
{
"description": "Logout default profile:",
"command": "<%= config.bin %> <%= command.id %>"
},
{
"description": "Logout selected profile",
"command": "<%= config.bin %> <%= command.id %> --profile my-profile"
}
],
"flags": {

@@ -134,3 +183,2 @@ "profile": {

"name": "profile",
"default": "default",
"hasDynamicHelp": false,

@@ -155,2 +203,3 @@ "multiple": false,

"strict": true,
"summary": "Logout of Apollo",
"enableJsonFlag": false,

@@ -167,3 +216,3 @@ "isESM": true,

"args": {},
"description": "View authentication status",
"description": "This command returns \"<profile>: Logged in\" if the selected profile has an\naccess token and \"<profile>: Logged out\" otherwise. Note that this command does\nnot check the validity of the access token.",
"flags": {

@@ -173,3 +222,2 @@ "profile": {

"name": "profile",
"default": "default",
"hasDynamicHelp": false,

@@ -194,2 +242,3 @@ "multiple": false,

"strict": true,
"summary": "View authentication status",
"enableJsonFlag": false,

@@ -202,5 +251,1396 @@ "isESM": true,

]
},
"assembly:add-fasta": {
"aliases": [],
"args": {},
"description": "Add new assembly from local or external fasta file",
"examples": [
{
"description": "From local file:",
"command": "<%= config.bin %> <%= command.id %> -i genome.fa -a myAssembly"
},
{
"description": "From external source we also need the URL of the index:",
"command": "<%= config.bin %> <%= command.id %> -i https://.../genome.fa -x https://.../genome.fa.fai -a myAssembly"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"input-file": {
"char": "i",
"description": "Input fasta file",
"name": "input-file",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Name for this assembly. Use the file name if omitted",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"index": {
"char": "x",
"description": "URL of the index. Required if input is an external source and ignored if input is a local file",
"name": "index",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"force": {
"char": "f",
"description": "Delete existing assembly, if it exists",
"name": "force",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "assembly:add-fasta",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"assembly",
"add-fasta.js"
]
},
"assembly:add-gff": {
"aliases": [],
"args": {},
"description": "The gff file is expected to contain sequences as per gff specifications.\nFeatures are also imported by default.",
"examples": [
{
"description": "Import sequences and features:",
"command": "<%= config.bin %> <%= command.id %> -i genome.gff -a myAssembly"
},
{
"description": "Import sequences only:",
"command": "<%= config.bin %> <%= command.id %> -i genome.gff -a myAssembly -o"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"input-file": {
"char": "i",
"description": "Input gff or gtf file",
"name": "input-file",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Name for this assembly. Use the file name if omitted",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"omit-features": {
"char": "o",
"description": "Do not import features, only upload the sequences",
"name": "omit-features",
"allowNo": false,
"type": "boolean"
},
"force": {
"char": "f",
"description": "Delete existing assembly, if it exists",
"name": "force",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "assembly:add-gff",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Add new assembly from gff or gft file",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"assembly",
"add-gff.js"
]
},
"assembly:check": {
"aliases": [],
"args": {},
"description": "Manage checks, i.e. the rules ensuring features in an assembly are plausible.\nThis command only sets the check to apply, to retrieve features flagged by these\nchecks use `apollo feature check`.",
"examples": [
{
"description": "View available check types:",
"command": "<%= config.bin %> <%= command.id %>"
},
{
"description": "View checks set for assembly hg19:",
"command": "<%= config.bin %> <%= command.id %> -a hg19"
},
{
"description": "Add checks to assembly:",
"command": "<%= config.bin %> <%= command.id %> -a hg19 -c CDSCheck"
},
{
"description": "Delete checks from assembly:",
"command": "<%= config.bin %> <%= command.id %> -a hg19 -c CDSCheck --delete"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Manage checks in this assembly",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"check": {
"char": "c",
"description": "Add these check names or IDs. If unset, print the checks set for assembly",
"name": "check",
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
},
"delete": {
"char": "d",
"description": "Delete (instead of adding) checks",
"name": "delete",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "assembly:check",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Add, view, or delete checks to assembly",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"assembly",
"check.js"
]
},
"assembly:delete": {
"aliases": [],
"args": {},
"description": "Assemblies to delete may be names or IDs",
"examples": [
{
"description": "Delete multiple assemblies using name or ID:",
"command": "<%= config.bin %> <%= command.id %> -a mouse 6605826fbd0eee691f83e73f"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Assembly names or IDs to delete",
"name": "assembly",
"required": true,
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
},
"verbose": {
"char": "v",
"description": "Print to stdout the array of assemblies deleted",
"name": "verbose",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "assembly:delete",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Delete assemblies",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"assembly",
"delete.js"
]
},
"assembly:get": {
"aliases": [],
"args": {},
"description": "Print to stdout the list of assemblies in json format",
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Get assemblies in this list of names or IDs",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "assembly:get",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Get available assemblies",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"assembly",
"get.js"
]
},
"assembly:sequence": {
"aliases": [],
"args": {},
"description": "Return the reference sequence for a given assembly and coordinates",
"examples": [
{
"description": "Get all sequences in myAssembly:",
"command": "<%= config.bin %> <%= command.id %> -a myAssembly"
},
{
"description": "Get sequence in coordinates chr1:1..1000:",
"command": "<%= config.bin %> <%= command.id %> -a myAssembly -r chr1 -s 1 -e 1000"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Find input reference sequence in this assembly",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"refseq": {
"char": "r",
"description": "Reference sequence. If unset, get all sequences",
"name": "refseq",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"start": {
"char": "s",
"description": "Start coordinate (1-based)",
"name": "start",
"default": 1,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"end": {
"char": "e",
"description": "End coordinate",
"name": "end",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "assembly:sequence",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Get reference sequence in fasta format",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"assembly",
"sequence.js"
]
},
"change:get": {
"aliases": [],
"args": {},
"description": "Return the change log in json format. Note that when an assembly is deleted the\nlink between common name and ID is lost (it can still be recovered by inspecting\nthe change log but at present this task is left to the user). In such cases you\nneed to use the assembly ID.",
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Get changes only for these assembly names or IDs (but see description)",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "change:get",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Get list of changes",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"change",
"get.js"
]
},
"refseq:get": {
"aliases": [],
"args": {},
"description": "Output the reference sequences in one or more assemblies in json format. This\ncommand returns the sequence characteristics (e.g., name, ID, etc), not the DNA\nsequences. Use `assembly sequence` for that.",
"examples": [
{
"description": "All sequences in the database:",
"command": "<%= config.bin %> <%= command.id %>"
},
{
"description": "Only sequences for these assemblies:",
"command": "<%= config.bin %> <%= command.id %> -a mm9 mm10"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Get reference sequences for these assembly names or IDs; use - to read it from stdin",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "refseq:get",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Get reference sequences",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"refseq",
"get.js"
]
},
"feature:add-child": {
"aliases": [],
"args": {},
"description": "See the other commands under `apollo feature` to retrive the parent ID of\ninterest and to populate the child feature with attributes.",
"examples": [
{
"description": "Add an exon at genomic coordinates 10..20 to this feature ID:",
"command": "<%= config.bin %> <%= command.id %> -i 6605826fbd0eee691f83e73f -t exon -s 10 -e 20"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Add a child to this feature ID; use - to read it from stdin",
"name": "feature-id",
"default": "-",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"start": {
"char": "s",
"description": "Start coordinate of the child feature (1-based)",
"name": "start",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"end": {
"char": "e",
"description": "End coordinate of the child feature (1-based)",
"name": "end",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"type": {
"char": "t",
"description": "Type of child feature",
"name": "type",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:add-child",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Add a child feature (e.g. add an exon to an mRNA)",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"add-child.js"
]
},
"feature:check": {
"aliases": [],
"args": {},
"description": "Use this command to view which features fail checks along with the reason for\nfailing. Use `apollo assembly check` for managing which checks should be applied\nto an assembly",
"examples": [
{
"description": "Get all check results in the database:",
"command": "<%= config.bin %> <%= command.id %>"
},
{
"description": "Get check results for assembly hg19:",
"command": "<%= config.bin %> <%= command.id %> -a hg19"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Get checks for these feature identifiers",
"name": "feature-id",
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Get checks for this assembly",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:check",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Get check results",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"check.js"
]
},
"feature:copy": {
"aliases": [],
"args": {},
"description": "The feature may be copied to the same or to a different assembly. he destination\nreference sequence may be selected by name only if unique in the database or by\nname and assembly or by identifier.",
"examples": [
{
"description": "Copy this feature ID to chr1:100 in assembly hg38:",
"command": "<%= config.bin %> <%= command.id %> -i 6605826fbd0eee691f83e73f -r chr1 -s 100 -a hg38"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Feature ID to copy to; use - to read it from stdin",
"name": "feature-id",
"default": "-",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"refseq": {
"char": "r",
"description": "Name or ID of target reference sequence",
"name": "refseq",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"start": {
"char": "s",
"description": "Start position in target reference sequence",
"name": "start",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Name or ID of target assembly. Not required if refseq is unique in the database",
"name": "assembly",
"required": false,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:copy",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Copy a feature to another location",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"copy.js"
]
},
"feature:delete": {
"aliases": [],
"args": {},
"description": "Note that deleting a child feature after deleting its parent will result in an\nerror unless you set -f/--force.",
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Feature IDs to delete",
"name": "feature-id",
"default": [
"-"
],
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
},
"force": {
"char": "f",
"description": "Ignore non-existing features",
"name": "force",
"allowNo": false,
"type": "boolean"
},
"dry-run": {
"char": "n",
"description": "Only show what would be delete",
"name": "dry-run",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:delete",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Delete one or more features by ID",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"delete.js"
]
},
"feature:edit-attribute": {
"aliases": [],
"args": {},
"description": "Be aware that there is no checking whether attributes names and values are\nvalid. For example, you can create non-unique ID attributes or you can set gene\nontology terms to non-existing terms",
"examples": [
{
"description": "Add attribute \"domains\" with a list of values:",
"command": "<%= config.bin %> <%= command.id %> -i 66...3f -a domains -v ABC PLD"
},
{
"description": "Print values in \"domains\" as json array:",
"command": "<%= config.bin %> <%= command.id %> -i 66...3f -a domains"
},
{
"description": "Delete attribute \"domains\"",
"command": "<%= config.bin %> <%= command.id %> -i 66...3f -a domains -d"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Feature ID to edit or \"-\" to read it from stdin",
"name": "feature-id",
"default": "-",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"attribute": {
"char": "a",
"description": "Attribute key to add or edit",
"name": "attribute",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"value": {
"char": "v",
"description": "New attribute value. Separated mutliple values by space to them as a list. If unset return current value",
"name": "value",
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
},
"delete": {
"char": "d",
"description": "Delete this attribute",
"name": "delete",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:edit-attribute",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Add, edit, or view a feature attribute",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"edit-attribute.js"
]
},
"feature:edit-coords": {
"aliases": [],
"args": {},
"description": "If editing a child feature that new coordinates must be within the parent's\ncoordinates. To get the identifier of the feature to edit consider using `apollo\nfeature get` or `apollo feature search`",
"examples": [
{
"description": "Edit start and end:",
"command": "<%= config.bin %> <%= command.id %> -i abc...xyz -s 10 -e 1000"
},
{
"description": "Edit end and leave start as it is:",
"command": "<%= config.bin %> <%= command.id %> -i abc...xyz -e 2000"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Feature ID to edit or \"-\" to read it from stdin",
"name": "feature-id",
"default": "-",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"start": {
"char": "s",
"description": "New start coordinate (1-based)",
"name": "start",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"end": {
"char": "e",
"description": "New end coordinate (1-based)",
"name": "end",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:edit-coords",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Edit feature start and/or end coordinates",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"edit-coords.js"
]
},
"feature:edit-type": {
"aliases": [],
"args": {},
"description": "Feature type is column 3 in gff format. It must be a valid sequence ontology\nterm although but the valifdity of the new term is not checked.",
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Feature ID to edit or \"-\" to read it from stdin",
"name": "feature-id",
"default": "-",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"type": {
"char": "t",
"description": "Assign feature to this type. If unset return the current type",
"name": "type",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:edit-type",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Edit or view feature type",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"edit-type.js"
]
},
"feature:edit": {
"aliases": [],
"args": {},
"description": "Edit a feature by submitting a json input with all the required attributes for\nApollo to process it. This is a very low level command which most users probably\ndo not need. \n \n Input may be a json string or a json file and it may be an array of changes.\nThis is an example input for editing feature type:\n\n {\n \"typeName\": \"TypeChange\",\n \"changedIds\": [\n \"6613f7d22c957525d631b1cc\"\n ],\n \"assembly\": \"6613f7d1360321540a11e5ed\",\n \"featureId\": \"6613f7d22c957525d631b1cc\",\n \"oldType\": \"BAC\",\n \"newType\": \"G_quartet\"\n }",
"examples": [
{
"description": "Editing by passing a json to stdin:",
"command": "echo '{\"typeName\": ... \"newType\": \"G_quartet\"}' | <%= config.bin %> <%= command.id %> -j -"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"json-input": {
"char": "j",
"description": "Json string or json file or \"-\" to read json from stdin",
"name": "json-input",
"default": "-",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:edit",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Edit features using an appropiate json input",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"edit.js"
]
},
"feature:get-id": {
"aliases": [],
"args": {},
"description": "Invalid identifiers or identifiers not found in the database will be silently\nignored",
"examples": [
{
"description": "Get features for these identifiers:",
"command": "<%= config.bin %> <%= command.id %> -i abc...zyz def...foo"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"feature-id": {
"char": "i",
"description": "Retrieves feature with these IDs. Use\n\"-\" to read IDs from stdin (one per\nline)",
"name": "feature-id",
"default": [
"-"
],
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:get-id",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Get features given their identifiers",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"get-id.js"
]
},
"feature:get": {
"aliases": [],
"args": {},
"description": "Get features in assembly, reference sequence or genomic window",
"examples": [
{
"description": "Get all features in myAssembly:",
"command": "<%= config.bin %> <%= command.id %> -a myAssembly"
},
{
"description": "Get features intersecting chr1:1..1000. You can omit the assembly name if there\nare no other reference sequences named chr1:",
"command": "<%= config.bin %> <%= command.id %> -a myAssembly -r chr1 -s 1 -e 1000"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Find input reference sequence in this assembly",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"refseq": {
"char": "r",
"description": "Reference sequence. If unset, query all sequences",
"name": "refseq",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"start": {
"char": "s",
"description": "Start coordinate (1-based)",
"name": "start",
"default": 1,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"end": {
"char": "e",
"description": "End coordinate",
"name": "end",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:get",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"get.js"
]
},
"feature:import": {
"aliases": [],
"args": {},
"description": "By default, features are added to the existing ones.",
"examples": [
{
"description": "Delete features in myAssembly and then import features.gff3:",
"command": "<%= config.bin %> <%= command.id %> -d -i features.gff3 -a myAssembly"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"input-file": {
"char": "i",
"description": "Input gff or gtf file",
"name": "input-file",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Import into this assembly name or assembly ID",
"name": "assembly",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"delete-existing": {
"char": "d",
"description": "Delete existing features before importing",
"name": "delete-existing",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:import",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Import features from local gff file",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"import.js"
]
},
"feature:search": {
"aliases": [],
"args": {},
"description": "Return features matching a query string. This command searches only in:\n \n - Attribute *values* (not attribute names)\n - Source field (which in fact is stored as an attribute)\n - Feature type\n \n The search mode is:\n \n - Case insensitive\n - Match only full words, but not necessarily the full value\n - Common words are ignored. E.g. \"the\", \"with\"\n \n For example, given this feature:\n \n chr1 example SNP 10 30 0.987 . . \"someKey=Fingerprint BAC with reads\"\n \n Queries \"bac\" or \"mRNA\" return the feature. Instead these queries will NOT\nmatch:\n \n - \"someKey\"\n - \"with\"\n - \"Finger\"\n - \"chr1\"\n - \"0.987\"",
"examples": [
{
"description": "Search \"bac\" in these assemblies:",
"command": "<%= config.bin %> <%= command.id %> -a mm9 mm10 -t bac"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"text": {
"char": "t",
"description": "Search for this text query",
"name": "text",
"required": true,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"assembly": {
"char": "a",
"description": "Assembly names or IDs to search; use \"-\" to read it from stdin. If omitted\nsearch all assemblies",
"name": "assembly",
"hasDynamicHelp": false,
"multiple": true,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "feature:search",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Free text search for feature in one or more assemblies",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"feature",
"search.js"
]
},
"user:get": {
"aliases": [],
"args": {},
"description": "If set, filters username and role must be both satisfied to return an entry",
"examples": [
{
"description": "By username:",
"command": "<%= config.bin %> <%= command.id %> -u Guest"
},
{
"description": "By role:",
"command": "<%= config.bin %> <%= command.id %> -r admin"
},
{
"description": "Use jq for more control:",
"command": "<%= config.bin %> <%= command.id %> | jq '.[] | select(.createdAt > \"2024-03-18\")'"
}
],
"flags": {
"profile": {
"description": "Use credentials from this profile",
"name": "profile",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"config-file": {
"description": "Use this config file (mostly for testing)",
"name": "config-file",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"username": {
"char": "u",
"description": "Find this username",
"name": "username",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"role": {
"char": "r",
"description": "Get users with this role",
"name": "role",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "user:get",
"pluginAlias": "@apollo-annotation/apollo-cli",
"pluginName": "@apollo-annotation/apollo-cli",
"pluginType": "core",
"strict": true,
"summary": "Get list of users",
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"user",
"get.js"
]
}
},
"version": "0.1.0"
"version": "0.1.1"
}
{
"name": "@apollo-annotation/apollo-cli",
"description": "CLI for managing an Apollo Collaboration Server",
"version": "0.1.0",
"description": "Command line interface for the Apollo annotation server",
"version": "0.1.1",
"author": "Apollo Team",

@@ -33,3 +33,3 @@ "repository": {

"prepare": "yarn build",
"test": "mocha 'src/**/*.test.ts'",
"test": "mocha --require src/test/fixtures.ts 'src/**/*.test.ts'",
"test:ci": "nyc mocha 'src/**/*.test.ts'",

@@ -44,2 +44,3 @@ "version": "oclif readme && git add README.md"

"@oclif/plugin-help": "^6.0.8",
"bson": "^6.3.0",
"joi": "^17.7.0",

@@ -65,3 +66,4 @@ "open": "^9.1.0",

"tsx": "^4.6.2",
"typescript": "^5.1.6"
"typescript": "^5.1.6",
"undici": "^6.7.0"
},

@@ -79,3 +81,20 @@ "oclif": {

"repositoryPrefix": "<%- repo %>/blob/v<%- version %>/packages/apollo-cli/<%- commandPath %>",
"topicSeparator": " "
"topicSeparator": " ",
"topics": {
"assembly": {
"description": "Commands to handle assemblies"
},
"change": {
"description": "Commands to handle the log of changes made to the database"
},
"feature": {
"description": "Commands to handle features"
},
"refseq": {
"description": "Commands to handle reference sequences"
},
"user": {
"description": "Commands to handle users"
}
}
},

@@ -82,0 +101,0 @@ "publishConfig": {

@@ -1,11 +0,5 @@

# oclif-hello-world
# Table of contents
oclif example Hello World CLI
[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![CircleCI](https://circleci.com/gh/oclif/hello-world/tree/main.svg?style=shield)](https://circleci.com/gh/oclif/hello-world/tree/main)
[![GitHub license](https://img.shields.io/github/license/oclif/hello-world)](https://github.com/oclif/hello-world/blob/main/LICENSE)
<!-- toc -->
* [oclif-hello-world](#oclif-hello-world)
* [Table of contents](#table-of-contents)
* [Usage](#usage)

@@ -23,3 +17,3 @@ * [Commands](#commands)

$ apollo (--version)
@apollo-annotation/apollo-cli/0.1.0 linux-x64 node-v18.20.2
@apollo-annotation/apollo-cli/0.1.1 linux-x64 node-v18.20.2
$ apollo --help [COMMAND]

@@ -35,15 +29,250 @@ USAGE

<!-- commands -->
* [`apollo assembly add-fasta`](#apollo-assembly-add-fasta)
* [`apollo assembly add-gff`](#apollo-assembly-add-gff)
* [`apollo assembly check`](#apollo-assembly-check)
* [`apollo assembly delete`](#apollo-assembly-delete)
* [`apollo assembly get`](#apollo-assembly-get)
* [`apollo assembly sequence`](#apollo-assembly-sequence)
* [`apollo change get`](#apollo-change-get)
* [`apollo config [KEY] [VALUE]`](#apollo-config-key-value)
* [`apollo feature add-child`](#apollo-feature-add-child)
* [`apollo feature check`](#apollo-feature-check)
* [`apollo feature copy`](#apollo-feature-copy)
* [`apollo feature delete`](#apollo-feature-delete)
* [`apollo feature edit`](#apollo-feature-edit)
* [`apollo feature edit-attribute`](#apollo-feature-edit-attribute)
* [`apollo feature edit-coords`](#apollo-feature-edit-coords)
* [`apollo feature edit-type`](#apollo-feature-edit-type)
* [`apollo feature get`](#apollo-feature-get)
* [`apollo feature get-id`](#apollo-feature-get-id)
* [`apollo feature import`](#apollo-feature-import)
* [`apollo feature search`](#apollo-feature-search)
* [`apollo help [COMMANDS]`](#apollo-help-commands)
* [`apollo login`](#apollo-login)
* [`apollo logout`](#apollo-logout)
* [`apollo refseq get`](#apollo-refseq-get)
* [`apollo status`](#apollo-status)
* [`apollo user get`](#apollo-user-get)
## `apollo assembly add-fasta`
Add new assembly from local or external fasta file
```
USAGE
$ apollo assembly add-fasta -i <value> [--profile <value>] [--config-file <value>] [-a <value>] [-x <value>] [-f]
FLAGS
-a, --assembly=<value> Name for this assembly. Use the file name if omitted
-f, --force Delete existing assembly, if it exists
-i, --input-file=<value> (required) Input fasta file
-x, --index=<value> URL of the index. Required if input is an external source and ignored if input is a local
file
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Add new assembly from local or external fasta file
EXAMPLES
From local file:
$ apollo assembly add-fasta -i genome.fa -a myAssembly
From external source we also need the URL of the index:
$ apollo assembly add-fasta -i https://.../genome.fa -x https://.../genome.fa.fai -a myAssembly
```
_See code: [src/commands/assembly/add-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/assembly/add-fasta.ts)_
## `apollo assembly add-gff`
Add new assembly from gff or gft file
```
USAGE
$ apollo assembly add-gff -i <value> [--profile <value>] [--config-file <value>] [-a <value>] [-o] [-f]
FLAGS
-a, --assembly=<value> Name for this assembly. Use the file name if omitted
-f, --force Delete existing assembly, if it exists
-i, --input-file=<value> (required) Input gff or gtf file
-o, --omit-features Do not import features, only upload the sequences
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Add new assembly from gff or gft file
The gff file is expected to contain sequences as per gff specifications.
Features are also imported by default.
EXAMPLES
Import sequences and features:
$ apollo assembly add-gff -i genome.gff -a myAssembly
Import sequences only:
$ apollo assembly add-gff -i genome.gff -a myAssembly -o
```
_See code: [src/commands/assembly/add-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/assembly/add-gff.ts)_
## `apollo assembly check`
Add, view, or delete checks to assembly
```
USAGE
$ apollo assembly check [--profile <value>] [--config-file <value>] [-a <value>] [-c <value>] [-d]
FLAGS
-a, --assembly=<value> Manage checks in this assembly
-c, --check=<value>... Add these check names or IDs. If unset, print the checks set for assembly
-d, --delete Delete (instead of adding) checks
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Add, view, or delete checks to assembly
Manage checks, i.e. the rules ensuring features in an assembly are plausible.
This command only sets the check to apply, to retrieve features flagged by these
checks use `apollo feature check`.
EXAMPLES
View available check types:
$ apollo assembly check
View checks set for assembly hg19:
$ apollo assembly check -a hg19
Add checks to assembly:
$ apollo assembly check -a hg19 -c CDSCheck
Delete checks from assembly:
$ apollo assembly check -a hg19 -c CDSCheck --delete
```
_See code: [src/commands/assembly/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/assembly/check.ts)_
## `apollo assembly delete`
Delete assemblies
```
USAGE
$ apollo assembly delete -a <value> [--profile <value>] [--config-file <value>] [-v]
FLAGS
-a, --assembly=<value>... (required) Assembly names or IDs to delete
-v, --verbose Print to stdout the array of assemblies deleted
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Delete assemblies
Assemblies to delete may be names or IDs
EXAMPLES
Delete multiple assemblies using name or ID:
$ apollo assembly delete -a mouse 6605826fbd0eee691f83e73f
```
_See code: [src/commands/assembly/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/assembly/delete.ts)_
## `apollo assembly get`
Get available assemblies
```
USAGE
$ apollo assembly get [--profile <value>] [--config-file <value>] [-a <value>]
FLAGS
-a, --assembly=<value>... Get assemblies in this list of names or IDs
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get available assemblies
Print to stdout the list of assemblies in json format
```
_See code: [src/commands/assembly/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/assembly/get.ts)_
## `apollo assembly sequence`
Get reference sequence in fasta format
```
USAGE
$ apollo assembly sequence [--profile <value>] [--config-file <value>] [-a <value>] [-r <value>] [-s <value>] [-e
<value>]
FLAGS
-a, --assembly=<value> Find input reference sequence in this assembly
-e, --end=<value> End coordinate
-r, --refseq=<value> Reference sequence. If unset, get all sequences
-s, --start=<value> [default: 1] Start coordinate (1-based)
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get reference sequence in fasta format
Return the reference sequence for a given assembly and coordinates
EXAMPLES
Get all sequences in myAssembly:
$ apollo assembly sequence -a myAssembly
Get sequence in coordinates chr1:1..1000:
$ apollo assembly sequence -a myAssembly -r chr1 -s 1 -e 1000
```
_See code: [src/commands/assembly/sequence.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/assembly/sequence.ts)_
## `apollo change get`
Get list of changes
```
USAGE
$ apollo change get [--profile <value>] [--config-file <value>] [-a <value>]
FLAGS
-a, --assembly=<value>... Get changes only for these assembly names or IDs (but see description)
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get list of changes
Return the change log in json format. Note that when an assembly is deleted the
link between common name and ID is lost (it can still be recovered by inspecting
the change log but at present this task is left to the user). In such cases you
need to use the assembly ID.
```
_See code: [src/commands/change/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/change/get.ts)_
## `apollo config [KEY] [VALUE]`
Get or set Apollo configuration options
Get or set apollo configuration options
```
USAGE
$ apollo config [KEY] [VALUE] [--profile <value>] [---file <value>]
$ apollo config [KEY] [VALUE] [--profile <value>] [---file <value>] [--get-config-file]

@@ -56,10 +285,441 @@ ARGUMENTS

--config-file=<value> Use this config file (mostly for testing)
--get-config-file Return the path to the config file and exit (this file may not exist yet)
--profile=<value> Profile to create or edit
DESCRIPTION
Get or set Apollo configuration options
Get or set apollo configuration options
Use this command to create or edit a user profile with credentials to access
Apollo. Configuration options are:
- address:
Address and port e.g http://localhost:3999
- accessType:
How to access Apollo. accessType is typically one of: google, microsoft, guest,
root. Allowed types depend on your Apollo setup
- accessToken:
Access token. Usually inserted by `apollo login`
- rootCredentials.username:
Username of root account. Only set this for "root" access type
- rootCredentials.password:
Password for root account. Only set this for "root" access type
EXAMPLES
Interactive setup:
$ apollo config
Setup with key/value pairs:
$ apollo config --profile admin address http://localhost:3999
Get current address for default profile:
$ apollo config address
```
_See code: [src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.0/packages/apollo-cli/src/commands/config.ts)_
_See code: [src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/config.ts)_
## `apollo feature add-child`
Add a child feature (e.g. add an exon to an mRNA)
```
USAGE
$ apollo feature add-child -s <value> -e <value> -t <value> [--profile <value>] [--config-file <value>] [-i <value>]
FLAGS
-e, --end=<value> (required) End coordinate of the child feature (1-based)
-i, --feature-id=<value> [default: -] Add a child to this feature ID; use - to read it from stdin
-s, --start=<value> (required) Start coordinate of the child feature (1-based)
-t, --type=<value> (required) Type of child feature
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Add a child feature (e.g. add an exon to an mRNA)
See the other commands under `apollo feature` to retrive the parent ID of
interest and to populate the child feature with attributes.
EXAMPLES
Add an exon at genomic coordinates 10..20 to this feature ID:
$ apollo feature add-child -i 6605826fbd0eee691f83e73f -t exon -s 10 -e 20
```
_See code: [src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/add-child.ts)_
## `apollo feature check`
Get check results
```
USAGE
$ apollo feature check [--profile <value>] [--config-file <value>] [-i <value>] [-a <value>]
FLAGS
-a, --assembly=<value> Get checks for this assembly
-i, --feature-id=<value>... Get checks for these feature identifiers
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get check results
Use this command to view which features fail checks along with the reason for
failing. Use `apollo assembly check` for managing which checks should be applied
to an assembly
EXAMPLES
Get all check results in the database:
$ apollo feature check
Get check results for assembly hg19:
$ apollo feature check -a hg19
```
_See code: [src/commands/feature/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/check.ts)_
## `apollo feature copy`
Copy a feature to another location
```
USAGE
$ apollo feature copy -r <value> -s <value> [--profile <value>] [--config-file <value>] [-i <value>] [-a <value>]
FLAGS
-a, --assembly=<value> Name or ID of target assembly. Not required if refseq is unique in the database
-i, --feature-id=<value> [default: -] Feature ID to copy to; use - to read it from stdin
-r, --refseq=<value> (required) Name or ID of target reference sequence
-s, --start=<value> (required) Start position in target reference sequence
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Copy a feature to another location
The feature may be copied to the same or to a different assembly. he destination
reference sequence may be selected by name only if unique in the database or by
name and assembly or by identifier.
EXAMPLES
Copy this feature ID to chr1:100 in assembly hg38:
$ apollo feature copy -i 6605826fbd0eee691f83e73f -r chr1 -s 100 -a hg38
```
_See code: [src/commands/feature/copy.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/copy.ts)_
## `apollo feature delete`
Delete one or more features by ID
```
USAGE
$ apollo feature delete [--profile <value>] [--config-file <value>] [-i <value>] [-f] [-n]
FLAGS
-f, --force Ignore non-existing features
-i, --feature-id=<value>... [default: -] Feature IDs to delete
-n, --dry-run Only show what would be delete
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Delete one or more features by ID
Note that deleting a child feature after deleting its parent will result in an
error unless you set -f/--force.
```
_See code: [src/commands/feature/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/delete.ts)_
## `apollo feature edit`
Edit features using an appropiate json input
```
USAGE
$ apollo feature edit [--profile <value>] [--config-file <value>] [-j <value>]
FLAGS
-j, --json-input=<value> [default: -] Json string or json file or "-" to read json from stdin
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Edit features using an appropiate json input
Edit a feature by submitting a json input with all the required attributes for
Apollo to process it. This is a very low level command which most users probably
do not need.
Input may be a json string or a json file and it may be an array of changes.
This is an example input for editing feature type:
{
"typeName": "TypeChange",
"changedIds": [
"6613f7d22c957525d631b1cc"
],
"assembly": "6613f7d1360321540a11e5ed",
"featureId": "6613f7d22c957525d631b1cc",
"oldType": "BAC",
"newType": "G_quartet"
}
EXAMPLES
Editing by passing a json to stdin:
echo '{"typeName": ... "newType": "G_quartet"}' | apollo feature edit -j -
```
_See code: [src/commands/feature/edit.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/edit.ts)_
## `apollo feature edit-attribute`
Add, edit, or view a feature attribute
```
USAGE
$ apollo feature edit-attribute -a <value> [--profile <value>] [--config-file <value>] [-i <value>] [-v <value>] [-d]
FLAGS
-a, --attribute=<value> (required) Attribute key to add or edit
-d, --delete Delete this attribute
-i, --feature-id=<value> [default: -] Feature ID to edit or "-" to read it from stdin
-v, --value=<value>... New attribute value. Separated mutliple values by space to them as a list. If unset return
current value
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Add, edit, or view a feature attribute
Be aware that there is no checking whether attributes names and values are
valid. For example, you can create non-unique ID attributes or you can set gene
ontology terms to non-existing terms
EXAMPLES
Add attribute "domains" with a list of values:
$ apollo feature edit-attribute -i 66...3f -a domains -v ABC PLD
Print values in "domains" as json array:
$ apollo feature edit-attribute -i 66...3f -a domains
Delete attribute "domains"
$ apollo feature edit-attribute -i 66...3f -a domains -d
```
_See code: [src/commands/feature/edit-attribute.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/edit-attribute.ts)_
## `apollo feature edit-coords`
Edit feature start and/or end coordinates
```
USAGE
$ apollo feature edit-coords [--profile <value>] [--config-file <value>] [-i <value>] [-s <value>] [-e <value>]
FLAGS
-e, --end=<value> New end coordinate (1-based)
-i, --feature-id=<value> [default: -] Feature ID to edit or "-" to read it from stdin
-s, --start=<value> New start coordinate (1-based)
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Edit feature start and/or end coordinates
If editing a child feature that new coordinates must be within the parent's
coordinates. To get the identifier of the feature to edit consider using `apollo
feature get` or `apollo feature search`
EXAMPLES
Edit start and end:
$ apollo feature edit-coords -i abc...xyz -s 10 -e 1000
Edit end and leave start as it is:
$ apollo feature edit-coords -i abc...xyz -e 2000
```
_See code: [src/commands/feature/edit-coords.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/edit-coords.ts)_
## `apollo feature edit-type`
Edit or view feature type
```
USAGE
$ apollo feature edit-type [--profile <value>] [--config-file <value>] [-i <value>] [-t <value>]
FLAGS
-i, --feature-id=<value> [default: -] Feature ID to edit or "-" to read it from stdin
-t, --type=<value> Assign feature to this type. If unset return the current type
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Edit or view feature type
Feature type is column 3 in gff format. It must be a valid sequence ontology
term although but the valifdity of the new term is not checked.
```
_See code: [src/commands/feature/edit-type.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/edit-type.ts)_
## `apollo feature get`
Get features in assembly, reference sequence or genomic window
```
USAGE
$ apollo feature get [--profile <value>] [--config-file <value>] [-a <value>] [-r <value>] [-s <value>] [-e
<value>]
FLAGS
-a, --assembly=<value> Find input reference sequence in this assembly
-e, --end=<value> End coordinate
-r, --refseq=<value> Reference sequence. If unset, query all sequences
-s, --start=<value> [default: 1] Start coordinate (1-based)
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get features in assembly, reference sequence or genomic window
EXAMPLES
Get all features in myAssembly:
$ apollo feature get -a myAssembly
Get features intersecting chr1:1..1000. You can omit the assembly name if there
are no other reference sequences named chr1:
$ apollo feature get -a myAssembly -r chr1 -s 1 -e 1000
```
_See code: [src/commands/feature/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/get.ts)_
## `apollo feature get-id`
Get features given their identifiers
```
USAGE
$ apollo feature get-id [--profile <value>] [--config-file <value>] [-i <value>]
FLAGS
-i, --feature-id=<value>... [default: -] Retrieves feature with these IDs. Use
"-" to read IDs from stdin (one per
line)
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get features given their identifiers
Invalid identifiers or identifiers not found in the database will be silently
ignored
EXAMPLES
Get features for these identifiers:
$ apollo feature get-id -i abc...zyz def...foo
```
_See code: [src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/get-id.ts)_
## `apollo feature import`
Import features from local gff file
```
USAGE
$ apollo feature import -i <value> -a <value> [--profile <value>] [--config-file <value>] [-d]
FLAGS
-a, --assembly=<value> (required) Import into this assembly name or assembly ID
-d, --delete-existing Delete existing features before importing
-i, --input-file=<value> (required) Input gff or gtf file
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Import features from local gff file
By default, features are added to the existing ones.
EXAMPLES
Delete features in myAssembly and then import features.gff3:
$ apollo feature import -d -i features.gff3 -a myAssembly
```
_See code: [src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/import.ts)_
## `apollo feature search`
Free text search for feature in one or more assemblies
```
USAGE
$ apollo feature search -t <value> [--profile <value>] [--config-file <value>] [-a <value>]
FLAGS
-a, --assembly=<value>... Assembly names or IDs to search; use "-" to read it from stdin. If omitted
search all assemblies
-t, --text=<value> (required) Search for this text query
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Free text search for feature in one or more assemblies
Return features matching a query string. This command searches only in:
- Attribute *values* (not attribute names)
- Source field (which in fact is stored as an attribute)
- Feature type
The search mode is:
- Case insensitive
- Match only full words, but not necessarily the full value
- Common words are ignored. E.g. "the", "with"
For example, given this feature:
chr1 example SNP 10 30 0.987 . . "someKey=Fingerprint BAC with reads"
Queries "bac" or "mRNA" return the feature. Instead these queries will NOT
match:
- "someKey"
- "with"
- "Finger"
- "chr1"
- "0.987"
EXAMPLES
Search "bac" in these assemblies:
$ apollo feature search -a mm9 mm10 -t bac
```
_See code: [src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/feature/search.ts)_
## `apollo help [COMMANDS]`

@@ -87,3 +747,3 @@

Log in to Apollo
Login to Apollo

@@ -93,2 +753,3 @@ ```

$ apollo login [--profile <value>] [--config-file <value>] [-a <value>] [-u <value>] [-p <value>] [-f]
[--port <value>]

@@ -101,13 +762,30 @@ FLAGS

--config-file=<value> Use this config file (mostly for testing)
--profile=<value> [default: default] Use credentials from this profile
--port=<value> [default: 3000] Get token by listening to this port number (usually this is >= 1024 and <
65536)
--profile=<value> Use credentials from this profile
DESCRIPTION
Log in to Apollo
Login to Apollo
Use the provided credentials to obtain and save the token to access Apollo. Once
the token for the given profile has been saved in the configuration file, users
do not normally need to execute this command again unless the token has expired.
To setup a new profile use "apollo config"
EXAMPLES
The most basic and probably most typical usage is to login using the default
profile in configuration file:
$ apollo login
Login with a different profile:
$ apollo login --profile my-profile
```
_See code: [src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.0/packages/apollo-cli/src/commands/login.ts)_
_See code: [src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/login.ts)_
## `apollo logout`
Log out of Apollo
Logout of Apollo

@@ -120,10 +798,53 @@ ```

--config-file=<value> Use this config file (mostly for testing)
--profile=<value> [default: default] Use credentials from this profile
--profile=<value> Use credentials from this profile
DESCRIPTION
Log out of Apollo
Logout of Apollo
Logout by removing the access token from the selected profile
EXAMPLES
Logout default profile:
$ apollo logout
Logout selected profile
$ apollo logout --profile my-profile
```
_See code: [src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.0/packages/apollo-cli/src/commands/logout.ts)_
_See code: [src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/logout.ts)_
## `apollo refseq get`
Get reference sequences
```
USAGE
$ apollo refseq get [--profile <value>] [--config-file <value>] [-a <value>]
FLAGS
-a, --assembly=<value>... Get reference sequences for these assembly names or IDs; use - to read it from stdin
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get reference sequences
Output the reference sequences in one or more assemblies in json format. This
command returns the sequence characteristics (e.g., name, ID, etc), not the DNA
sequences. Use `assembly sequence` for that.
EXAMPLES
All sequences in the database:
$ apollo refseq get
Only sequences for these assemblies:
$ apollo refseq get -a mm9 mm10
```
_See code: [src/commands/refseq/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/refseq/get.ts)_
## `apollo status`

@@ -139,9 +860,48 @@

--config-file=<value> Use this config file (mostly for testing)
--profile=<value> [default: default] Use credentials from this profile
--profile=<value> Use credentials from this profile
DESCRIPTION
View authentication status
This command returns "<profile>: Logged in" if the selected profile has an
access token and "<profile>: Logged out" otherwise. Note that this command does
not check the validity of the access token.
```
_See code: [src/commands/status.ts](https://github.com/GMOD/Apollo3/blob/v0.1.0/packages/apollo-cli/src/commands/status.ts)_
_See code: [src/commands/status.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/status.ts)_
## `apollo user get`
Get list of users
```
USAGE
$ apollo user get [--profile <value>] [--config-file <value>] [-u <value>] [-r <value>]
FLAGS
-r, --role=<value> Get users with this role
-u, --username=<value> Find this username
--config-file=<value> Use this config file (mostly for testing)
--profile=<value> Use credentials from this profile
DESCRIPTION
Get list of users
If set, filters username and role must be both satisfied to return an entry
EXAMPLES
By username:
$ apollo user get -u Guest
By role:
$ apollo user get -r admin
Use jq for more control:
$ apollo user get | jq '.[] | select(.createdAt > "2024-03-18")'
```
_See code: [src/commands/user/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.1/packages/apollo-cli/src/commands/user/get.ts)_
<!-- commandsstop -->