YAZ-CLIENT(1)
π YAZ-CLIENT(1) π
okay bestie, gather round, because this is the manual page for yaz-client in the Commands section and it is lowkey iconic. it's giving "tool for people who actually build this stuff." let's go π«Ά
β¨ NAME β¨
yaz-client β the Z39.50/SRU client for implementors π
πΈ SYNOPSIS πΈ
yaz-client [-a apdulog] [-b berdump] [-c cclfile] [-C certfname]
[-d dump] [-e | --check-cert] [-f cmdfile] [-k size]
[-m marclog] [-p proxy-addr] [-q cqlfile] [-t dispcharset]
[-u auth] [-v loglevel] [-V] [-x] [server-addr]
π¦ DESCRIPTION π¦
so yaz-client is a Z39.50[1]/SRU[2] client (an origin, in the β¨technicalβ¨ sense) and it has this whole simple command line interface whose entire job is letting you test how Z39.50 targets and SRU servers behave and perform. it's a vibe check for servers, no cap.
and starting from YAZ version 4.1.0, yaz-client can also serve as a Solr[3] Web Service client. versatility!! we love her π
if you pass the server-addr, the client goes ahead and creates a connection to the Z39.50/SRU target at that address. instant bestie connection.
when yaz-client starts up, it tries to read commands from one of these files, in this order:
- The command file, if you gave it with the option
-f. .yazclientrcin the current working directory..yazclientrcin the user's home directory. the value of the$HOMEenvironment variable is what decides the home directory. and ngl,$HOMEis normally only set on POSIX systems such as Linux, FreeBSD, Solaris. so on other systems? that last one just isn't happening, sorry babe π
π OPTIONS π
-afilename β if you set this, logging of protocol packages gets appended to the file you named. and if filename is literally-, the output goes to stdout instead. cute!-bfilename β if you set this, YAZ will dump BER data in readable notation to the file specified. and again, if filename is-, output goes to stdout π-cfilename β if you set this, CCL configuration is read from the file you gave.-Ccertfname β specifies a PEM file with the client certificate and private key living together in one file. OR, alternatively, specifycertificate-file,key-filewhen they're separate little individuals π«Ά-ddump β if you set this, YAZ dumps BER data for all PDUs sent and received into individual files nameddump.DDD.raw, whereDDDis001,002,003, ... and on and on β¨-e|--check-certβ makesyaz-clientverify the server certificate and hostname when it's using HTTPS or SSL over Z39.50. security!! we stan π-fcmdfile β reads commands from cmdfile. and heads up: when you use this option, YAZ client does not read.yazclientrcfrom the current directory or from the home directory. it's her world now.-ksize β sets the preferred messages and maximum record size for the Initialize Request, measured in kilobytes. default value is65536(that's 64 MB, bestie).-mfilename β if you set this, retrieved records get appended to the file you gave.-pproxy-addr β if you set this, the client uses the proxy at the address you gave. YAZ client connects to a proxy on the address and port given. the actual target gets specified as part of the InitRequest, so the proxy knows who we're actually talking to. sneaky but honest π-qfilename β if you set this, CQL configuration gets read from the file you gave.-tdisplaycharset β if displaycharset is given, it specifies the name of the character set of the output β i.e. on the terminal where YAZ client is running.-uauth β if you set this, the auth string is used for authentication.-vlevel β sets the LOG level to level. level is a sequence of tokens separated by commas. each token is either an integer or a named LOG item, and those named items are:fatal,debug,warn,log,malloc,all,none.-Vβ prints the YAZ version. that's it. that's the whole job. β¨-xβ makes the YAZ client print hex dumps of the packages sent and received on standard output. full transparency, babes.
π COMMANDS π
the YAZ client accepts the following commands. buckle up, there's a whole roster π
openzurl β opens a connection to a server. the syntax for zurl is exactly the same as described above for connecting from the command line.
Syntax:
[(tcp|ssl|unix|http)':']host [:port][/base]
quitβ quits YAZ client. goodbye bestie πfindquery β sends a Search Request using the query you gave. by default the query is assumed to be PQF. for more info, go look at the commandquerytype.deletesetname β deletes the result set with the name setname over on the server.basebase1 base2 ... β sets the name(s) of the database(s) to search. you can give one or more databases, separated by blanks. this command overrides the database given in zurl.show[start[+number [+resultset]]]β fetches records by sending a Present Request from the start position given by start and a number of records given by number, from the result set resultset. if start isn't given, the client fetches from the position of the last retrieved record plus 1. if number isn't given, then one record gets fetched at a time. if resultset isn't given, the most recently retrieved result set is the one used. defaults on defaults, she contains multitudes πscanterm β scans the database index for a term. the syntax basically matches the syntax forfind. so if you wanna scan for the word water, you'd write:
scan water
but if you want to scan only in, say, the title field, you'd write:
scan @attr 1=4 water
setscanset term β scans the database index for a term within a result set. it's likescanbut its first argument is a result set instead. glow-up πscanpospos β sets the preferred position for scan. this value is used in the next scan. by default, position is1.scansizesize β sets the number of entries to be returned by scan. the default number of entries is20.scanstepstep β sets the step-size for scan. this value is used in the next scan sent to the target. by default, step-size is0.sortsortspecs β sorts a result set. thesortcommand takes a sequence of space-separated sort specifications, and each sort specification is made of two space-separated words (so the whole specification list ends up being an even number of words, no cap). the first word of each specification holds a field (the sort criterion) and the second holds flags. if the sort criterion includes=, it's assumed that the SortKey is of typesortAttributesusing Bib-1: in that case the integer before=is the attribute type and the integer after=is the attribute value. if there's no=character in the criterion, it's treated as asortfieldof typeInternationalString. the flags word of each sort specification must consist ofsfor case sensitive orifor case insensitive, plus<for ascending order or>for descending order.
example using a sort criterion with attributes use=local-number and structure=numeric and the ascending flag:
1=12,4=109 <
another example, this time with the "Title" sort field and the descending flag:
Title >
sort+β same assort, except it stores the sorted result set in a new result set. it's giving "keep both, babe" πauthentication[auth1 [auth2 [auth3]]]β configures authentication strings to be sent to the server. zero, one, two or three arguments may follow theauthcommand.
if no (0) arguments are given, no authentication string is sent.
if one argument is given, the Z39.50 v2 OpenStyle authentication is used. a common convention for the auth1 string is that the username and password are separated by a slash, e.g. myusername/mysecret.
if two or more arguments are given, Z39.50 v3 authentication is used, in which case the first argument is used, the second argument is the group and the third argument is the password. if only two arguments are given, the group is assumed to be empty.
and just like the other commands in yaz-client, the arguments are separated by whitespace β but a backslash character can be used to include a character verbatim. for example, auth myuser a\ b is a two argument auth command where the user is myuser and the password is a b. iconic escape behaviour π
the authentication string is first sent to the server when the open command is issued and the Z39.50 Initialize Request is sent β so this command must be used before open in order to be effective. order matters, bestie.
srumethod version β selects the Web Service method and version. method must be one ofpost,get,soap(that's the default) orsolr. version should be either1.1,1.2or2.0for SRU. other versions are allowed too β for testing purposes (version negotiation with an SRU server, iykyk). the version is currently not used for Solr Web Services.list_allβ this command displays status and values for many settings. a whole lil dashboard β¨lslbn β sets the limit for when no records should be returned together with the search result. see the Z39.50 standard on set bounds[4] for more details.ssubn β sets the limit for when all records should be returned with the search result. see the Z39.50 standard on set bounds[4] for more details.mspnn β sets the number of records that should be returned if the number of records in the result set is between the values oflslbandssub. see the Z39.50 standard on set bounds[4] for more details.statusβ displays the values oflslb,ssubandmspn.setnameβ switches named result sets on and off. default is on.cancelβ sends a Trigger Resource Control Request to the target. βοΈfacetsspec β specifies requested facets to be used in search. the notation is specified in???. (yes, genuinely???, we're all just living in it π)formatoid β sets the preferred transfer syntax for retrieved records.yaz-clientsupports all the record syntaxes that are currently registered. see Z39.50 Record Syntax Identifiers[5] for more details. commonly used record syntaxes includeusmarc,sutrsandxml.elementse β sets the element set name for the records. many targets support the element setsB(for brief) andF(for full).closeβ sends a Z39.50 Close APDU and closes the connection with the peer. so polite about it too π«Άquerytypetype β sets the query type as used by the commandfind. this is what's supported:prefixfor Prefix Query Notation (Type-1 Query);cclfor CCL search (Type-2 Query),cqlfor CQL (Type-104 search with CQL OID),ccl2rpnfor CCL to RPN conversion (Type-1 Query),cql2rpnfor CQL to RPN conversion (Type-1 Query).attributesetset β sets the attribute set OID for prefix queries (RPN, Type-1).refidid β sets the reference ID for Z39.50 Request(s).itemordertype no β sends an Item Order Request using the ILL External. type is either1or2, which correspond to ILL-Profile 1 and 2 respectively. no is the Result Set position of the record to be ordered. π¦
π update action recid doc
okay so this one sends an Item Update Request β¨ and it's giving very main-character energy. Here's the breakdown:
- action β the action type. Has to be one of
insert,replace,deleteandupdate. No off-menu orders bestie. - recid β the record identifier. Any string you want, fr fr, it's that chill.
- doc β optional third argument, the record document for the request. But here's the plot twist π: if doc is preceded with
<, then the characters that follow are treated as a filename holding the records to be updated. Otherwise doc is treated as the document itself. You can also wrap doc in double quotes π - if doc gets omitted entirely? No worries β the last received record (as part of a present response or a piggybacked search response) is used for the update. recycling era β»οΈ
π source filename
Executes a whole list of commands from the file filename, just like source on most UNIX shells. And a single dot (.) can be used as an alternative, because typing less is self-care. π
π₯ ! args
Executes command args in a subshell using the system call. Yes bestie, that's your little escape hatch to the shell. π«Ά
π°οΈ push_command command
The push_command takes another command as its argument. That command is then added to the history information (so you can retrieve it later). The command itself is not executed β it's just getting tucked in for later π€ This command only works if you have GNU readline/history enabled.
π set_apdufile filename
Sets that APDU should be logged to file filename. Another way to achieve APDU log is by using command-line option -a. two paths, one destiny β¨
π set_auto_reconnect flag
Specifies whether YAZ client automatically reconnects if the target closes connection (Z39.50 only).
flag must be either on or off. That's it, that's the whole vibe. π¦
β³ set_auto_wait flag
Specifies whether YAZ client should wait for response protocol packages after a request. By default YAZ client waits (on) for response packages immediately after a command (find, show) has been issued. If off is used, YAZ client does not attempt to receive packages automatically β those will have to be manually received when command wait_response is used.
flag must be either on or off. π
πΎ set_marcdump filename
Specifies that all retrieved records should be appended to file filename. This command does the same thing as option -m.
ποΈ schema schemaid
Specifies schema for retrieval. Schema may be specified as an OID for Z39.50. For SRU, schema is a simple string URI.
π charset negotiationcharset [displaycharset] [[marccharset]]
Specifies character set (encoding) for Z39.50 negotiation / SRU encoding and/or character set for output (terminal).
- negotiationcharset is the name of the character set to be negotiated by the server. The special name
-for negotiationcharset specifies no character set to be negotiated. - If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). To disable conversion of characters to the output encoding, the special name
-(dash) can be used. If the special nameautois given, YAZ client will convert strings to the encoding of the terminal as returned bynl_langinfocall. - If marccharset is given, it specifies name of the character set of retrieved MARC records from server. See also
marccharsetcommand.
β οΈ Note β Since character set negotiation takes effect in the Z39.50 Initialize Request you should issue this command before command open is used. Like, do it BEFORE, bestie, or it simply will not count π
β οΈ Note β MARC records are not covered by Z39.50 character set negotiation, so that's why there is a separate character that must be known in order to do meaningful conversion(s).
π§ negcharset charset
Specifies character set for negotiation (Z39.50). The argument is the same as second argument for command charset.
π₯οΈ displaycharset charset
Specifies character set for output (display). The argument is the same as second argument for command charset.
π marccharset charset
Specifies character set for retrieved MARC records so that YAZ client can display them in a character suitable for your display. See charset command. If auto is given, YAZ will assume that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1 for all other MARC variants. The charset argument is the same as third argument for command charset.
π querycharset charset
Specifies character set for query terms for Z39.50 RPN queries and Z39.50 Scan Requests (termListAndStartPoint). This is a pure client-side conversion which converts from displayCharset to queryCharset. π
π set_cclfile filename
Specifies that CCL fields should be read from file file filename. (yes they really wrote "file file", iconic tbh π) This command does the same thing as option -c.
π set_cqlfile filename
Specifies that CQL fields should be read from file file filename. This command does the same thing as option -q.
π register_oid name class OID
This command allows you to register your own object identifier β so that instead of entering a long dot-notation you can use a short name instead. The name is your name for the OID, class is the class, and OID is the raw OID in dot notation. Class is one of: appctx, absyn, attet, transyn, diagset, recsyn, resform, accform, extserv, userinfo, elemspec, varset, schema, tagset, general. If you're in doubt use the general class. π
β¨οΈ register_tab command string
This command registers a TAB completion string for the command given. tiny convenience, huge slay π₯
π΄ sleep seconds
This command makes YAZ client sleep (be idle) for the number of seconds given. me too honestly π
π wait_response [ number]
This command makes YAZ client wait for a number of response packages from target. If number is omitted, 1 is assumed.
This command is rarely used and is only useful if command set_auto_wait is set to off. the niche-est of the niche π¦
π¨ xmles OID doc
Sends XML Extended Services request using the OID and doc given.
π·οΈ zversion ver
This command sets Z39.50 version for negotiation. Should be used before open. By default 3 (version 3) is used.
βοΈ options op1 op2..
This command sets Z39.50 options for negotiation. Should be used before open.
The following options are supported: search, present, delSet, resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl, scan, sort, extendedServices, level_1Segmentation, level_2Segmentation, concurrentOperations, namedResultSets, encapsulation, resultCount, negotiationModel, duplicationDetection, queryType104, pQESCorrection, stringSchema.
πΈ EXAMPLE πΈ
The simplest example of a Prefix Query would be something like
f knuth
or
f "donald knuth"
In those queries, no attributes were specified. This leaves it up to the server what fields to search but most servers will search in all fields. Some servers do not support this feature though, and require that some attributes are defined. To add one attribute you could do:
f @attr 1=4 computer
where we search in the title field, since the use(1) is title(4). If we want to search in the author field and in the title field, and in the title field using right truncation it could look something like this:
f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
Finally using a mix of Bib-1 and GILS attributes could look something like this:
f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
π FILES π
yaz-<version>/client/client.c$HOME/.yazclientrc$HOME/.yazclient.history
π SEE ALSO π
π AUTHORS π
Index Data
π NOTES π
- Z39.50
https://loc.gov/standards/z3950/agency/ - SRU
https://loc.gov/standards/sru/ - Solr
https://solr.apache.org - Z39.50 standard on set bounds
https://loc.gov/standards/z3950/agency/markup/04.html#3.2.2.1.6 - Z39.50 Record Syntax Identifiers
https://loc.gov/standards/z3950/agency/defns/oids.html#5
and that's the whole page bestie, you made it to the end π«Άπ this is YAZ 5.38.1, dated 10/16/2026, and it lives in the manual as YAZ-CLIENT(1). go forth and query, you gorgeous icon β¨
π¦ where this page comes from
- arch rolling: yaz 5.38.1-1 Β· LicenseRef-yaz
- fedora 44: yaz 5.38.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms